WPF

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class NavigationItem - WPF API Reference | Syncfusion SfNavigationDrawer control. ">

    Show / Hide Table of Contents

    Class NavigationItem

    Implements a selectable item in a SfNavigationDrawer control.

    Inheritance
    System.Object
    NavigationItem
    Implements
    System.IDisposable
    Namespace: Syncfusion.UI.Xaml.NavigationDrawer
    Assembly: Syncfusion.SfNavigationDrawer.WPF.dll
    Syntax
    public class NavigationItem : HeaderedItemsControl, IDisposable

    Constructors

    NavigationItem()

    Initializes a new instance of the NavigationItem class.

    Declaration
    public NavigationItem()

    Fields

    CommandParameterProperty

    Identifies the CommandParameter dependency property.

    Declaration
    public static readonly DependencyProperty CommandParameterProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the CommandParameter dependency property.

    CommandProperty

    Identifies the Command dependency property.

    Declaration
    public static readonly DependencyProperty CommandProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the Command dependency property.

    ExpanderTemplateProperty

    Identifies the ExpanderTemplate dependency property.

    Declaration
    public static readonly DependencyProperty ExpanderTemplateProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the ExpanderTemplate dependency property.

    IconMemberPathProperty

    Identifies the IconMemberPath dependency property.

    Declaration
    public static readonly DependencyProperty IconMemberPathProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the IconMemberPath dependency property.

    See Also
    System.Windows.Controls.ItemsControl.ItemsSource

    IconProperty

    Identifies the Icon dependency property.

    Declaration
    public static readonly DependencyProperty IconProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the Icon dependency property.

    IconTemplateProperty

    Identifies the IconTemplate dependency property.

    Declaration
    public static readonly DependencyProperty IconTemplateProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsChildSelectedProperty

    Identifies the IsChildSelected dependency property.

    Declaration
    public static readonly DependencyProperty IsChildSelectedProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the IsChildSelected dependency property.

    IsExpandedProperty

    Identifies the IsExpanded dependency property.

    Declaration
    public static readonly DependencyProperty IsExpandedProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the IsExpanded dependency property.

    IsSelectedProperty

    Identifies the IsSelected dependency property.

    Declaration
    public static readonly DependencyProperty IsSelectedProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the IsSelected dependency property.

    ItemsProperty

    Identifies the Items dependency property.

    Declaration
    public static readonly DependencyProperty ItemsProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the Items dependency property.

    ItemTypeProperty

    Identifies the ItemType dependency property.

    Declaration
    public static readonly DependencyProperty ItemTypeProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the ItemType dependency property.

    SelectionBackgroundProperty

    Identifies the SelectionBackground dependency property.

    Declaration
    public static readonly DependencyProperty SelectionBackgroundProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    The identifier for the SelectionBackground dependency property.

    Properties

    Command

    Gets or sets the command to invoke when this item is pressed.

    Declaration
    public ICommand Command { get; set; }
    Property Value
    Type Description
    System.Windows.Input.ICommand

    The default value is null.

    Remarks

    A command to invoke when the ItemType is Tab or Button is pressed. The default value is null.

    See Also
    CommandParameter

    CommandParameter

    Gets or sets the parameter to pass to the Command property.

    Declaration
    public object CommandParameter { get; set; }
    Property Value
    Type Description
    System.Object

    The default value is null.

    See Also
    Command

    ExpanderTemplate

    Gets or sets the DataTemplate for the expander view in NavigationItem.

    Declaration
    public DataTemplate ExpanderTemplate { get; set; }
    Property Value
    Type Description
    System.Windows.DataTemplate

    The object that defines the visual representation of the expander view. The default value is null.

    Remarks
    Below example shows how to use the ExpanderTemplate property.
    <syncfusion:SfNavigationDrawer x:Name="navigationDrawer" DisplayMode="Expanded">
      <syncfusion:NavigationItem Header = "Account" x:Name="Account" IsSelected="True" IsExpanded="True">
         <syncfusion:NavigationItem.ExpanderTemplate>
           <DataTemplate >
               <Grid>
                 <Path Visibility = "{Binding Path=IsExpanded,ElementName=Account,Converter={StaticResource BooleanToVisibilityConverter},ConverterParameter=Open}"
                                Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 10 L 20 10 L 10 0 Z" Fill="Black" Stretch="Fill" />
                <Path Visibility = "{Binding Path=IsExpanded,ElementName=Account,Converter={StaticResource BooleanToVisibilityConverter},ConverterParameter=Closed}" Data="M 0 0 L 10 10 L 20 0 Z"
                                Fill="Black" HorizontalAlignment="Center" Height="16" Stretch="Fill" VerticalAlignment="Center" Width="14"/>
             </Grid>
        </DataTemplate>
          </syncfusion:NavigationItem.ExpanderTemplate>
        <syncfusion:NavigationItem Header = "Mail" >
             <syncfusion:NavigationItem.Icon>
                 <Path x:Name="Mail" Data="M1,1.3379326 L1,9.0000003 15,9.0000003 15,1.3390059 8.0009872,5.1179975 z M2.4799501,0.99999999 L8.0009872,3.9809962 13.522035,0.99999999 z M0,0 L16,0 16,10 0,10 z" Fill="Black" HorizontalAlignment="Center" Height="10" Stretch="Fill" VerticalAlignment="Center" Width="16"/>
             </syncfusion:NavigationItem.Icon>
         </syncfusion:NavigationItem>
    </syncfusion:NavigationItem>
    </syncfusion:SfNavigationDrawer>
    The NavigationItem will be the data context for each ExpanderTemplate.
    See Also
    IsExpanded

    Icon

    Gets or sets the icon view for the NavigationItem.

    Declaration
    public object Icon { get; set; }
    Property Value
    Type Description
    System.Object

    The default value is null.

    IconMemberPath

    Gets or sets the path to a value on the System.Windows.Controls.ItemsControl.ItemsSource object to serve as the visual representation of the icon.

    Declaration
    public string IconMemberPath { get; set; }
    Property Value
    Type Description
    System.String

    The path to a value on the source object. This can be any path, or an XPath such as @Name. The default is an empty string.

    Remarks

    If used the ItemTemplate, then the IconMemberPath does not work.

    See Also
    ItemsSource

    IconTemplate

    Gets or sets the data template for the icon in NavigationItem.

    Declaration
    public DataTemplate IconTemplate { get; set; }
    Property Value
    Type Description
    System.Windows.DataTemplate

    IsChildSelected

    Gets a value indicating whether the NavigationItem has sub item selected on any sub level.

    Declaration
    public bool IsChildSelected { get; }
    Property Value
    Type Description
    System.Boolean

    true if sub items was selected; otherwise, false.The default value is false.

    IsExpanded

    Gets or sets a value indicating the expansion state of NavigationItem.

    Declaration
    public bool IsExpanded { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if NavigationItem is expanded; otherwise, false.The default value is false.

    See Also
    ExpanderTemplate

    IsSelected

    Gets or sets a value indicating whether the NavigationItem is selected.

    Declaration
    public bool IsSelected { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if NavigationItem is selected; otherwise, false.The default value is false.

    Items

    Gets or sets the collection of child items displayed in the NavigationItem

    Declaration
    public NavigationItemsCollection Items { get; set; }
    Property Value
    Type Description
    NavigationItemsCollection

    The collection is used to generate the child items in the NavigationItem. The default is null.

    Examples

    This example demonstrates how to set Items in XAML.

     <syncfusion:SfNavigationDrawer x:Name="navigationDrawer" DisplayMode="Expanded">
                <syncfusion:NavigationItem Header="Inbox">
                    <syncfusion:NavigationItem.Icon>
                        <Path Width="15" Height="15" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M32.032381, 16.445429 L25.410999, 23 22.598995, 23 15.853724, 16.561278 3.4150009, 29 44.586115, 29z M2.0000003, 3.3371553 L2.0000003, 27.587 14.406845, 15.180154z M46.000002, 2.6187388 L33.45355, 15.038597 46.000002, 27.585888z M3.4950623, 2.0000003 L23.399998, 21 24.589001, 21 43.782564, 2.0000003z M0, 0 L48.000002, 0 48.000002, 31 0, 31z" Fill="Transparent" Stretch="Fill" Stroke="#FF262626" />
                    </syncfusion:NavigationItem.Icon>
                    <syncfusion:NavigationItem Header="Item1" >
                        <syncfusion:NavigationItem.Icon>
                            <Path Width="15" Height="15" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M6.9999996,48.353 L19,48.353 19,50.353 6.9999996,50.353z M6.9999996,42.353 L32,42.353 32,44.353 6.9999996,44.353z M6.9999996,36.353 L32,36.353 32,38.353 6.9999996,38.353z M6.4999996,30.353 L31.5,30.353 31.5,32.353 6.4999996,32.353z M25.523109,22.610376 L24.94,25.014999 27.461736,24.549429z M0,15.853 L23,15.853 23,17.853 1.9999989,17.853 1.9999989,54.853 37,54.853 37,21.853 39,21.853 39,56.853 0,56.853z M40.953857,5.9638548 L26.382576,20.641725 29.510826,23.770661 44.083183,9.0931849z M44.058998,2.8360004 L42.362705,4.5447035 45.492099,7.6741037 47.184002,5.9699993 z M44.055,0 L50.004001,5.9659996 30.003,26.115 22.271,27.542999 24.065,20.137z" Fill="Transparent" Stretch="Fill" Stroke="#FF262626" />
                        </syncfusion:NavigationItem.Icon>
                    </syncfusion:NavigationItem>
                    <syncfusion:NavigationItem Header="Item2">
                        <syncfusion:NavigationItem.Icon>
                            <Path Width="15" Height="15" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M42.128046,6.7269681 L18.53705,30.317964 25.278003,43.798z M40.380997,5.6460154 L4.6410007,23.1 17.108567,28.918443z M47.383005,0 L25.364002,48.443 16.582001,30.878999 0,23.141z" Fill="Transparent" Stretch="Fill" Stroke="#FF262626" />
                        </syncfusion:NavigationItem.Icon>
                    </syncfusion:NavigationItem>
                </syncfusion:NavigationItem>
                <syncfusion:NavigationItem Header="Drafts" >
                    <syncfusion:NavigationItem.Icon>
                        <Path Width="15" Height="15" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M6.9999996,48.353 L19,48.353 19,50.353 6.9999996,50.353z M6.9999996,42.353 L32,42.353 32,44.353 6.9999996,44.353z M6.9999996,36.353 L32,36.353 32,38.353 6.9999996,38.353z M6.4999996,30.353 L31.5,30.353 31.5,32.353 6.4999996,32.353z M25.523109,22.610376 L24.94,25.014999 27.461736,24.549429z M0,15.853 L23,15.853 23,17.853 1.9999989,17.853 1.9999989,54.853 37,54.853 37,21.853 39,21.853 39,56.853 0,56.853z M40.953857,5.9638548 L26.382576,20.641725 29.510826,23.770661 44.083183,9.0931849z M44.058998,2.8360004 L42.362705,4.5447035 45.492099,7.6741037 47.184002,5.9699993 z M44.055,0 L50.004001,5.9659996 30.003,26.115 22.271,27.542999 24.065,20.137z" Fill="Transparent" Stretch="Fill" Stroke="#FF262626" />
                    </syncfusion:NavigationItem.Icon>
                </syncfusion:NavigationItem>
                <syncfusion:NavigationItem Header="Sent">
                    <syncfusion:NavigationItem.Icon>
                        <Path Width="15" Height="15" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M42.128046,6.7269681 L18.53705,30.317964 25.278003,43.798z M40.380997,5.6460154 L4.6410007,23.1 17.108567,28.918443z M47.383005,0 L25.364002,48.443 16.582001,30.878999 0,23.141z" Fill="Transparent" Stretch="Fill" Stroke="#FF262626" />
                    </syncfusion:NavigationItem.Icon>
                </syncfusion:NavigationItem>
            </syncfusion:SfNavigationDrawer>

    ItemType

    Gets or sets a value that indicates the type of item.

    Declaration
    public ItemType ItemType { get; set; }
    Property Value
    Type Description
    ItemType

    One of the ItemType enumeration that specifies how the item is rendered. The default value is Tab.

    SelectionBackground

    Gets or sets the background for the selection marker.

    Declaration
    public Brush SelectionBackground { get; set; }
    Property Value
    Type Description
    System.Windows.Media.Brush

    The brush used to apply for the selection marker. The default value is #0099BC.

    Methods

    Dispose()

    Dispose all the allocated resources.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Dispose the instances, if parameter is true.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    Represents the boolean value for disposing objects.

    OnApplyTemplate()

    Initializes all the child elements of the NavigationItem control.

    Declaration
    public override void OnApplyTemplate()

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved