menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SymbolFilterProvider - API Reference

    Show / Hide Table of Contents

    Class SymbolFilterProvider

    Represents a collection of Filters in Stencil.

    Inheritance
    System.Object
    SymbolFilterProvider
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.UI.Xaml.Diagram.Stencil
    Assembly: Syncfusion.SfDiagram.WPF.dll
    Syntax
    public class SymbolFilterProvider : 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 Description
    System.Windows.Input.ICommand

    Content

    Gets or sets a content of symbol filter.

    Declaration
    public object Content { get; set; }
    Property Value
    Type Description
    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 Description
    System.Windows.DataTemplate

    IsChecked

    Gets or sets a value that indicates whether this symbol filter should be added to the SymbolGroupHeader list when the SymbolFilterDisplayMode is List. The default value is set to false.

    Declaration
    public bool IsChecked { get; set; }
    Property Value
    Type Description
    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" SymbolFilterDisplayMode="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>

    #ViewModel.cs

    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 Description
    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 Description
    System.ComponentModel.PropertyChangedEventHandler

    Implements

    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved