You can exclude symbol templates from other layers, by setting TemplatePicker.LayerIDs property. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client.Toolkit~ESRI.ArcGIS.Client.To...In your XAML, add this code:LayerIDs="Evacuation Perimeter"
If you want to further limit the symbol templates to specific symbols, you can create a two-way binding on TemplatePicker.Templates and your own class that implements INotifyPropertyChanged.
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;
}
Another way is to use Editor.Add instead of TemplatePicker and for Button.Content, you can consider using ESRI.ArcGIS.Client.Toolkit.Primitives.SymbolDisplay.