public MainPage()
        {
            InitializeComponent();

            var s = new SimpleMarkerSymbol();
            s.OnSymbolChanged += StringChanged;
            s.OnSymbolChanged += (sen, eve) =>
            {
                txtjson.Text = eve.Symbolstring;
                ucstylepreview.SymbolString = txtjson.Text;
            };
            s.SetValue(Grid.RowProperty, 0);
            s.SetValue(Grid.ColumnProperty, 0);
            grduc.Children.Clear();
            grduc.Children.Add(s);
            //initializing first time
            txtjson.Text = s.SymbolString;
            ucstylepreview.SymbolString = s.SymbolString;
        }
 private void cbxsymboltype_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (grduc!=null)
     {
         switch ((sender as ComboBox).SelectedIndex)
         {
             case 0:
                 {
                     var s = new SimpleMarkerSymbol();
                     s.OnSymbolChanged += StringChanged;
                     s.OnSymbolChanged += (sen, eve) =>
                     {
                         txtjson.Text = eve.Symbolstring;
                         ucstylepreview.SymbolString = txtjson.Text;
                     };
                     s.SetValue(Grid.RowProperty, 0);
                     s.SetValue(Grid.ColumnProperty, 0);
                     grduc.Children.Clear();
                     grduc.Children.Add(s);
                     //initializing first time
                     txtjson.Text = s.SymbolString;
                     ucstylepreview.SymbolString = s.SymbolString;
                     break;
                 }
             case 1:
                 {
                     var s = new SimpleLineSymbol();
                     s.OnSymbolChanged += StringChanged;
                     s.OnSymbolChanged += (sen, eve) =>
                     {
                         txtjson.Text = eve.Symbolstring;
                         ucstylepreview.SymbolString = txtjson.Text;
                     };
                     s.SetValue(Grid.RowProperty, 0);
                     s.SetValue(Grid.ColumnProperty, 0);
                     grduc.Children.Clear();
                     grduc.Children.Add(s);
                     //initializing first time
                     txtjson.Text = s.SymbolString;
                     ucstylepreview.SymbolString = s.SymbolString;
                     break;
                 }
             case 2:
                 {
                     var s = new SimpleFillSymbol();
                     s.OnSymbolChanged += StringChanged;
                     s.OnSymbolChanged += (sen, eve) =>
                     {
                         txtjson.Text = eve.Symbolstring;
                         ucstylepreview.SymbolString = txtjson.Text;
                     };
                     s.SetValue(Grid.RowProperty, 0);
                     s.SetValue(Grid.ColumnProperty, 0);
                     grduc.Children.Clear();
                     grduc.Children.Add(s);
                     //initializing first time
                     txtjson.Text = s.SymbolString;
                     ucstylepreview.SymbolString = s.SymbolString;
                     break;
                 }
             case 3:
                 {
                     var s = new PictureMarkerSymbol();
                     s.OnSymbolChanged += StringChanged;
                     s.OnSymbolChanged += (sen, eve) =>
                     {
                         txtjson.Text = eve.Symbolstring;
                         ucstylepreview.SymbolString = txtjson.Text;
                     };
                     s.SetValue(Grid.RowProperty, 0);
                     s.SetValue(Grid.ColumnProperty, 0);
                     grduc.Children.Clear();
                     grduc.Children.Add(s);
                     //initializing first time
                     txtjson.Text = s.SymbolString;
                     ucstylepreview.SymbolString = s.SymbolString;
                     break;
                 }
             case 4:
                 {
                     var s = new PictureFillSymbol();
                     s.OnSymbolChanged += StringChanged;
                     s.OnSymbolChanged += (sen, eve) =>
                     {
                         txtjson.Text = eve.Symbolstring;
                         ucstylepreview.SymbolString = txtjson.Text;
                     };
                     s.SetValue(Grid.RowProperty, 0);
                     s.SetValue(Grid.ColumnProperty, 0);
                     grduc.Children.Clear();
                     grduc.Children.Add(s);
                     //initializing first time
                     txtjson.Text = s.SymbolString;
                     ucstylepreview.SymbolString = s.SymbolString;
                     break;
                 }
         }
     }
 }