I can add a graphic with a textbox marker symbol, but it does not respond to the GraphicsLayer.MouseLeftButtonUp event. I want to allow users to delete the text graphic with GraphicsLayer.Graphics.Remove(e.Graphic) in that event.
You can use a MarkerSymbol with TextBox. Maybe create a two-way binding on a graphic.Attribute too if you want TextBox.Text saved per graphic. <esri:MarkerSymbol x:Key="MySymbol"> <esri:MarkerSymbol.ControlTemplate> <ControlTemplate> <TextBox Text="Type here"/> </ControlTemplate> </esri:MarkerSymbol.ControlTemplate> </esri:MarkerSymbol>
<esri:MarkerSymbol x:Key="MySymbol"> <esri:MarkerSymbol.ControlTemplate> <ControlTemplate> <TextBox Text="Type here"/> </ControlTemplate> </esri:MarkerSymbol.ControlTemplate> </esri:MarkerSymbol>
Trying to add the value from the textbox in code behind when adding the graphics to the custom map. no success.How can I set the two way binding for the textbox inside the markersymbol control template?Thanks very much
<esri:MarkerSymbol x:Key="MySymbol"> <esri:MarkerSymbol.ControlTemplate> <ControlTemplate> <TextBox Text="{Binding Attributes[MyAttribute], Mode=TwoWay, TargetNullValue=Null}"/> </ControlTemplate> </esri:MarkerSymbol.ControlTemplate> </esri:MarkerSymbol>
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.