Create a NetLogic to modify the image

Prerequisites

Set the default external code editor. See Set the default code editor.

To create the NetLogic to hide the image
  1. In Project view, right-click MainWindow (type) and select New > Runtime NetLogic.
  2. Double-click the NetLogic.
    The external code editor opens.
  3. Edit the NetLogic by replacing it with the following code. See Edit a NetLogic.
    #region Using directives
    using FTOptix.NetLogic;
    using FTOptix.UI;
    #endregion
    
    public class RuntimeNetLogic1 : BaseNetLogic
    {
        public override void Start()
        {
            // Insert code to be executed when the user-defined logic starts
        }
    
        public override void Stop()
        {
            // Insert code to be executed when the user-defined logic is stopped
        }
    
        [ExportMethod]
        public void replaceSVG()
        {
            // LogicObject.Owner is the button, so LogicObject.Owner is the MainWindow
            AdvancedSVGImage svgImage = LogicObject.Owner.Children.Get<AdvancedSVGImage>("AdvancedSVGImage1");
    
            string myXML = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<svg version=\"1.1\" id=\"Overall\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\" viewBox=\"0 0 300 300\">\r\n  <g id=\"Box1\">\r\n    <polygon style=\"fill:#CB8252;\" points=\"25,270 75,270 75,220 25,220\" transform=\"rotate(0, 20, 20)\"/>\r\n  </g>\r\n</svg>\r\n";
    
            //Update the SVG
            svgImage.SetImageContent(myXML);
        }
    }
  4. Save the code.