Skip to main content
A newer version of this page is available. .

NavBarItemSelectingEventArgs.NewItem Property

Gets an item object that is going to be selected.

Namespace: DevExpress.Xpf.NavBar

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.NavBar, DevExpress.Wpf.Navigation

Declaration

public NavBarItem NewItem { get; }

Property Value

Type Description
NavBarItem

A NavBarItem object representing the item being selected.

Example

In this example, the NavBarViewBase.ItemSelecting event is handled, to invoke a confirmation dialog allowing the selection of a specific item (‘Private’) to be canceled.

View Example

private void navBar_ItemSelecting(object sender, NavBarItemSelectingEventArgs e){
    if (e.NewItem.Content.ToString() == "Private"){
        MessageBoxResult result = MessageBox.Show("Are you sure to select the 'Private' item?", "Confirm Dialog", MessageBoxButton.YesNo);
        e.Cancel = (result == MessageBoxResult.No);
    }
}
See Also