Class SymbolFilterProvider
Represents a collection of Filters in Stencil.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Diagram.Stencil
Assembly: Syncfusion.SfDiagram.WPF.dll
Syntax
public class SymbolFilterProvider : Object, INotifyPropertyChanged
Constructors
SymbolFilterProvider()
Declaration
public SymbolFilterProvider()
Properties
Command
Gets the Checked command to invoke when click the filter in the more shapes menu item.
Declaration
public ICommand Command { get; }
Property Value
Type |
---|
System.Windows.Input.ICommand |
Content
Gets or sets a content of symbol filter.
Declaration
public object Content { get; set; }
Property Value
Type |
---|
System.Object |
ContentTemplate
Gets or sets the data template used to display the content of the ContentControl.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type |
---|
System.Windows.DataTemplate |
IsChecked
Gets or sets a value that indicates whether this symbol filter should be added to the SymbolGroupHeader list when the SymbolGroupDisplayMode is List. The default value is set to false.
Declaration
public bool IsChecked { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
Below example shows how to add the symbol filter to the SymbolGroupHeader list. #MainWindow.xaml
<Window.DataContext>
<local:StencilVM></local:StencilVM>
</Window.DataContext>
<syncfusion:Stencil x:Name="stencil" Width="250" Title="Stencil Shapes" SymbolGroupDisplayMode="List" SymbolFilters="{Binding Symbolfilters}" SelectedFilter="{Binding Selectedfilter}">
<!--Initialize the SymbolSource-->
<syncfusion:Stencil.SymbolSource>
<!--Define the SymbolCollection-->
<syncfusion:SymbolCollection>
<syncfusion:NodeViewModel Key = "Basic Shapes" Name="Triangle" OffsetX="100" OffsetY="100" UnitHeight="100" UnitWidth="100" Shape="{StaticResource Triangle}" ShapeStyle="{StaticResource nodestyle}" >
</syncfusion:NodeViewModel>
</syncfusion:SymbolCollection>
</syncfusion:Stencil.SymbolSource>
<syncfusion:Stencil.SymbolGroups>
<syncfusion:SymbolGroups>
<!--Separate groups based on the key-->
<syncfusion:SymbolGroupProvider MappingName = "Key" />
</ syncfusion:SymbolGroups>
</syncfusion:Stencil.SymbolGroups>
</syncfusion:Stencil>
public class StencilVM : INotifyPropertyChanged
{
public StencilVM()
{
Symbolfilters = new SymbolFilters();
SymbolFilterProvider node1 = new SymbolFilterProvider { Content = "Basic Shapes",IsChecked=true, SymbolFilter = Filter };
this.Symbolfilters.Add(node1);
this.Selectedfilter = Symbolfilters[0];
}
//Define filtering of Symbols
private bool Filter(SymbolFilterProvider sender, object symbol)
{
if (symbol is NodeViewModel)
{
if (sender.Content.ToString() == (symbol as NodeViewModel).Key.ToString())
return true;
}
return false;
}
public ObservableCollection<SymbolFilterProvider> Symbolfilters { get; set; }
public SymbolFilterProvider Selectedfilter { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
}
SymbolFilter
Gets or sets a delegate to represent selected filter in Stencil.
Declaration
public FilterPredicate SymbolFilter { get; set; }
Property Value
Type |
---|
FilterPredicate |
Methods
OnPropertyChanged(String)
Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides OnPropertyChanged(name).
Declaration
protected virtual void OnPropertyChanged(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |