jamesmontemagno / Xam.NavDrawer

Navigation Drawer Sample + MvvmCross Sample for Xamarin.Android
122 stars 96 forks source link

Set shared checkable behavior across all groups in NavigationView #13

Closed jorgenstorlie closed 8 years ago

jorgenstorlie commented 8 years ago

In the sample using NavigationView only items in the first group is checked. I want to make items in second group checked too.

something like this: http://howtobox.org/how-to-set-shared-checkable-behavior-across-all-groups-in-navigationview/

    IMenu m = navigationView.Menu;

            for (int i = 0; i <= m.Size () - 1; i++) {
                IMenuItem mi = m.GetItem (i);
                if (!(mi == e.MenuItem))
                {
                    mi.SetCheckable (false);
                }
            }

            e.MenuItem.SetCheckable (true);
            e.MenuItem.SetChecked (true);

does this make sense?

Can you add this this too the sample?