I am trying to add a custom control over the SIRI map. For this, I am using marker symbol, now I have to access the 'eventsRadial1' control with the back of the code, which is under the control of MarkerSymbol. How can I do this?
& lt; Esri: marker symbol x: key = "eventreadial symbol" & gt; & Lt; ESRI: MarkerSymbol.ControlTemplate & gt; & Lt; ControlTemplate & gt; & Lt; Mary: EventsRadial HorizontalAlignment = "left" Margin = "15,15,0,0" x: Name = "EventsRadiall" VerticalAlignment = "top" / & gt; & Lt; / ControlTemplate & gt; & Lt; / ESRI: MarkerSymbol.ControlTemplate & gt; & Lt; / ESRI: MarkerSymbol & gt; is
I do not know how you solve that problem, but I also The conflict is the same issue and came with a solution
First of all make a custom marker symbol like the code given below.
public class TextBoxMarkerSymbol: MarkerSymbol {public static DependencyProperty ContentTextProperty = DependencyProperty.Register ( "ContentText", typeof (string), typeof (TextBoxMarkerSymbol), New PropertyMetadata (OnTextChanged)) read-only; // personal string contentText; Public String ContentText {get {return (string) GetValue (ContentTextProperty); } Set {set value (content text property, value); }} Private static void OnTextChanged (DependencyObject d, DependencyPropertyChangedEventArgs e) {} public TextBoxMarkerSymbol (int width, int height) {String template = "& LT; ControlTemplate" + "xmlns = 'http: //schemas.microsoft.com/winfx / 2006 / xaml / presentation 'xmlns: x =' http: //schemas.microsoft.com/winfx/2006/xaml'> "+" & Lt; canvas & gt; "; Template + = "& LT; Name text box = 'TxtText" Text = "{Binding Symbol.ContentText, mode = TwoWay, UpdateSourceTrigger = PropertyChanged}' height = '+ height +' width = '+ width +' '/ & Gt; "; Template + = "& lt; / canvas & gt;" + "& Lt; / ControlTemplate & gt;"; System.IO.MemoryStream template stream = new system.IO.MemoryStream (System.Text.UTF8Encoding.Default.GetBytes (template)); this. ControlTemplate = System.Windows.Markup.XamlReader.Load (Templatestream) as ControlTemplate; }} This trick here is that you can not directly access your control because there are no marker control views.
So you have to define the dependency properties for your control properties, so that you can force them using the symbol
then you can enter the code as your Icons can be used:
TextBoxMarkerSymbol mSymbol = new TextBoxMarkerSymbol (width, height); MSymbol.OffsetX = width / 2; MSymbol.OffsetY = height / 2; MSymbol.ContentText = "test binding"; There is a good day.
Comments
Post a Comment