LayerIDs="Evacuation Perimeter"
public MainPage() { InitializeComponent(); MyTemplates myTemplates = new MyTemplates(); Binding b = new Binding("Templates"); b.Source = myTemplates; b.Mode = BindingMode.TwoWay; MyTemplatePicker.SetBinding(TemplatePicker.TemplatesProperty, b); }
public class MyTemplates : INotifyPropertyChanged { public MyTemplates() { } private IEnumerable<SymbolTemplate> templates; public IEnumerable<SymbolTemplate> Templates { get { return templates; } set { if (templates != value && value != null) { SymbolTemplate st = null; foreach (var t in value) { if (t.Name == "Mandatory Evacuation") { st = t; break; } } if(st != null) { templates = new List<SymbolTemplate>() { st }; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Templates")); } } } } public event PropertyChangedEventHandler PropertyChanged; }
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.