WPF Navigation Drawer: Navigation Made Easy | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (174).NET Core  (29).NET MAUI  (207)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (215)BoldSign  (14)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (66)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (100)Streamlit  (1)Succinctly series  (131)Syncfusion  (915)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (36)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (147)Chart  (131)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (628)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (40)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (507)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (592)What's new  (332)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
WPF Navigation Drawer: Navigation Made Easy

WPF Navigation Drawer: Navigation Made Easy

A good UI design for an application enhances the user experience by making the application easy to use. This, in turn, increases the number of users for the application. In this article, we will show you a modern method of navigating a WPF desktop application that provides a consistent experience. The modern navigation in the application is achieved using Syncfusion’s WPF Navigation Drawer.

The Navigation Drawer is a sidebar view that is used to create a navigation menu. You can place the drawer on any side of the screen. It allows you to handle navigation between major modules of an application.

Navigation menu design

The WPF Navigation Drawer contains the following two panes:

  1. Sidebar pane: This pane can be loaded with navigation items such as tabs, headers, separators, and buttons. You can also include multiple levels by using the tab navigation item, which is useful when organizing and prioritizing a list.
  2. Main content pane: This pane displays the main content of the application. The contents can be organized as needed to provide a satisfying visual presentation.
Visual Structure of WPF Navigation Drawer
Visual Structure of WPF Navigation Drawer

Different display modes

The WPF Navigation Drawer provides default, compact and extended display modes to create a navigation UI menu that adapts to a variety of screen sizes. Refer to the following code example.

<syncfusion:SfNavigationDrawer DisplayMode="Expanded">
   <syncfusion:NavigationItem Header="Inbox">
      <syncfusion:NavigationItem.Icon>
         <Path Data="…" />
      </syncfusion:NavigationItem.Icon>
   </syncfusion:NavigationItem>
   <syncfusion:NavigationItem Header="Sent mail">
      <syncfusion:NavigationItem.Icon>
         <Path Data="…" />
      </syncfusion:NavigationItem.Icon>
   </syncfusion:NavigationItem>
</syncfusion:SfNavigationDrawer>

The compact mode provides a simple thin bar that is expanded and overlaid when the toggle button is tapped. The pane returns to its narrow bar state on tapping anywhere in the application.

The extended mode renders the drawer pane in a fully expanded view, pushing the main content to the right of the sidebar pane.

Note: For more information, refer to the navigation items in WPF Navigation Drawer demos.

Extended display mode in WPF Navigation Drawer
Extended Display Mode in WPF Navigation Drawer

Auto mode switching

You can switch between compact and extended display modes at runtime based on the available size to best fit the content. You can enable the auto sizing behavior using the AutoDisplayMode property.

Auto mode switching in WPF Navigation Drawer
Auto Mode Switching in WPF Navigation Drawer

Powerful data binding

Our WPF Navigation Drawer provides built-in support for populating items. You can bind the Navigation Drawer to different sources such as objects and collections, and the control supports DataTemplate. You can also apply different styles to the header, navigation items, and footer items.

Refer to the following code example.

<Window.DataContext> 
  <local:ViewModel /> 
</Window.DataContext> 
<Window.Resources> 
  <Style x:Key="ItemStyle" TargetType="syncfusion:NavigationItem"> 
     <Setter Property="Icon" Value="{Binding Icon}" /> 
     <Setter Property="DisplayMemberPath" Value="Item" /> 
     <Setter Property="ItemsSource" Value="{Binding SubItems}" /> 
  </Style> 
</Window.Resources> 
<syncfusion:SfNavigationDrawer DisplayMemberPath="Item"  
                               DisplayMode="Expanded"  
                               ItemContainerStyle="{StaticResource ItemStyle}" 
                               ItemsSource="{Binding Items}"> 
</syncfusion:SfNavigationDrawer>

Note: For more information, refer to the various items sources supported in WPF Navigation Drawer demos.

Item types

You can load the navigation menu with the navigation items. These items can be set based on the predefined item types such as tab, button, separator and header. The tab item type provides end users a child item upon clicking. This feature is incredibly useful when you are looking to organize and prioritize a list of items in a multilevel hierarchy.

Refer to the following example which shows an email application with sub folders.

<syncfusion:SfNavigationDrawer DisplayMode="Compact">
     <syncfusion:NavigationItem Header="Johnson Martin"   
                                ItemType="Header">
          <syncfusion:NavigationItem.Icon>
                  …….
          </syncfusion:NavigationItem.Icon>
     </syncfusion:NavigationItem>
     <syncfusion:NavigationItem Header="Inbox"
                                ItemType="Tab"
                                IsExpanded="True">
          <syncfusion:NavigationItem.Icon>
                  …….
          </syncfusion:NavigationItem.Icon>
          <syncfusion:NavigationItem Header="Primary">
               <syncfusion:NavigationItem.Icon>
                  …….
               </syncfusion:NavigationItem.Icon>
          </syncfusion:NavigationItem>
          <syncfusion:NavigationItem Header="Social">
               <syncfusion:NavigationItem.Icon>
                 …….
                </syncfusion:NavigationItem.Icon>
           </syncfusion:NavigationItem>
           <syncfusion:NavigationItem Header="Promotions">
                    <syncfusion:NavigationItem.Icon>
                      ……….
                    </syncfusion:NavigationItem.Icon>
           </syncfusion:NavigationItem>
       </syncfusion:NavigationItem>
   </syncfusion:NavigationItem>
</syncfusion:SfNavigationDrawer>

Note: For more information, refer to the item types in WPF Navigation Drawer demos.

Different items included in the WPF Navigation Drawer
Different Items Included in the WPF Navigation Drawer

Custom views

You can populate the Navigation Drawer with custom views by setting the DisplayMode property as Default. In the Default mode, you can provide custom views to the DrawerHeaderView, DrawerContentView and DrawerFooterView properties.

Note: For more information, refer to the WPF Navigation Drawer custom view demos.

Custom View for WPF Navigation Drawer
Custom View for WPF Navigation Drawer

Conclusion

Thanks for reading! In this blog, we have learned about the Syncfusion WPF Navigation Drawer and its user-friendly features. You can refer to the WPF Navigation Drawer demos and documentation for a complete guide to all the available features in the control. Use these features to enable seamless navigation in your desktop app!

Also, browse through our WPF demos and documentation to learn more about all of our WPF controls. In addition, our demos are available in the Microsoft Store and we have .NET Core demos available in the App center.

If you aren’t a customer yet, you can try our 30-day free trial to check out these features.

If you wish to send us feedback or submit any questions, please feel free to post them in the comments section of this blog post. You can also contact us through our support forumfeedback portal, or Direct-Trac support system. We are always happy to assist you!

If you like this blog post, we think you’ll also like the following articles too:

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed