/// <summary>
 /// Sets the value of the OriginalSource attached property to a specified PictureMarkerSymbol.
 /// </summary>
 /// <param name="element">The PictureMarkerSymbol to which the attached property is written.</param>
 /// <param name="value">The needed OriginalSource value.</param>
 public static void SetOriginalSource(PictureMarkerSymbol element, string value)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(OriginalSourceProperty, value);
 }
 /// <summary>
 /// Sets the value of the OriginalSource attached property to a specified PictureMarkerSymbol.
 /// </summary>
 /// <param name="element">The PictureMarkerSymbol to which the attached property is written.</param>
 /// <param name="value">The needed OriginalSource value.</param>
 public static void SetOriginalSource(PictureMarkerSymbol element, string value)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(OriginalSourceProperty, value);
 }
示例#3
0
        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;
                }
                }
            }
        }