예제 #1
0
        void NavView_NavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs e)
        {
            if (previousItem != null)
            {
                previousItem.SetChecked(false);
            }

            navView.SetCheckedItem(e.MenuItem.ItemId);

            previousItem = e.MenuItem;

            int id = 0;

            switch (e.MenuItem.ItemId)
            {
            case Resource.Id.nav_vision:
                id = (int)AppPage.Vision;
                break;

            case Resource.Id.nav_emotion:
                id = (int)AppPage.Emotion;
                break;

            case Resource.Id.nav_face:
                id = (int)AppPage.Face;
                break;
            }
            this.Element.OnNavigationItemSelected(new NavigationItemSelectedEventArgs
            {
                Index = id
            });
        }
예제 #2
0
        private void NavigationViewOnNavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs navigationItemSelectedEventArgs)
        {
            _previousMenuItem?.SetChecked(false);

            _navigationView.SetCheckedItem(navigationItemSelectedEventArgs.MenuItem.ItemId);
            _previousMenuItem = navigationItemSelectedEventArgs.MenuItem;

            var pageId = 0;

            switch (navigationItemSelectedEventArgs.MenuItem.ItemId)
            {
            case Resource.Id.nav_home:
                pageId = 0;
                break;
            }

            Element.OnNavigationItemSelected(new NavigationItemSelectedEventArgs()
            {
                Index = pageId
            });
        }