SfNavigationDrawer with item list disable some items dynamically

Hi,
I have a SfNavigationDrawer with an item list like so :

https://pastebin.com/Rn1uPvGm

How can I disable some of the items with my list (seetting disable on some items dynamically) ?

3 Replies 1 reply marked as answer

SS Suganya Sethuraman Syncfusion Team June 21, 2021 09:34 AM UTC

Hi Geoffrey,

Greetings from Syncfusion.

We have analyzed your query. We are not aware of the specific application scenario. Could you please provide the following information?

1. Provide an Items Datatype that is bound to the SfNavigationDrawer's ItemsSource.

2. When will you disable the specific NavigationItem, either through the ItemClicked event or another scenario?

This will help us to investigate further and provide a better solution at earliest.

Regards,
Suganya Sethuraman.
 



GE Geoffrey June 29, 2021 03:47 PM UTC

Hello,

Here is my xaml :  https://pastebin.com/Rn1uPvGm & here is my MVVM : https://pastebin.com/DC5TF0kj (item list)

Complete code here : https://github.com/myerffoeg/polystone/blob/master/Polystone/Views/MainWindow.xaml & here https://github.com/myerffoeg/polystone/blob/master/Polystone/ViewModels/MainWindowViewModel.cs I want to disable some items from my MVVM.

Thank you.



SS Suganya Sethuraman Syncfusion Team June 30, 2021 09:32 AM UTC

Hi Geoffrey,

We have analyzed your requirement. We can disable the SfNavigationItem by setting the IsEnabled property to false. However, since we are using Items as an ObservableCollection<object>, we will need to use ItemsStyle. All SfNavigationItems are disabled if the IsEnable property of the ItemContainerStyle is set to false. As a result, using Items as an ObservableCollectionobject> does not meet your requirements. Only when we use SfNavigationItem directly in Xaml instead of Items as ObservableCollectionobject> can we achieve this.

Please let us know if you have any other concerns.
 
Regards,
Suganya Sethuraman.
 


Marked as answer
Loader.
Up arrow icon