Skip to main content

NavBarViewBase.GetNavBarItem(RoutedEventArgs) Method

Gets an item related to the event whose data is passed via the method’s parameter.

Namespace: DevExpress.Xpf.NavBar

Assembly: DevExpress.Xpf.NavBar.v21.2.dll


public NavBarItem GetNavBarItem(
    RoutedEventArgs e


Name Type Description
e RoutedEventArgs

A RoutedEventArgs descendant specifying the routed event.


Type Description

A NavBarItem object representing the item related to the specified event. If no item relates to the event, null (Nothing in Visual Basic) is returned.


When an end-user performs any actions within a view (such as clicks or hovers the view, etc), responding to these actions may be required, to determine the underlying group or item that corresponds to the event generated by the action. Use the GetNavBarItem method to obtain an item relating to the event that is described by the passed event argument.

using DevExpress.Xpf.NavBar;
        public Window1(){

            navBar.View.Click += new RoutedEventHandler(View_Click);

        void View_Click(object sender, RoutedEventArgs e){
            NavBarGroup group = navBar.View.GetNavBarGroup(e);
            NavBarItem item = navBar.View.GetNavBarItem(e);
            if (group != null || item != null)
                MessageBox.Show("Click - " + (item != null ? "Item: " + item.Content : "Group: " + group.Header));
See Also