示例#1
0
        public MainWindow()
        {
            InitializeComponent();

            UpdateAppTitleBarMargin(NavView);

            NavView.SelectedItem = NavViewItems.OfType <HamburgerMenuItem>().First();
            Navigate(NavView.SelectedItem);
        }
        public MainWindow()
        {
            InitializeComponent();

            DataContext = AccountManager.instance;

            AccountBox.ItemsSource = AccountManager.instance;
            NavView.SelectedItem   = NavViewItems.OfType <HamburgerMenuItem>().First();
            Navigate(NavView.SelectedItem);
        }
        private void ContentFrame_Navigated(object sender, NavigationEventArgs e)
        {
            NavView.SelectedItem        = NavViewItems.OfType <HamburgerMenuItem>().FirstOrDefault(x => GetNavigateUri(x) == e.Uri);
            NavView.SelectedOptionsItem = NavViewOptions.OfType <HamburgerMenuItem>().FirstOrDefault(x => GetNavigateUri(x) == e.Uri);

            var selectedItem = NavView.SelectedItem ?? NavView.SelectedOptionsItem;

            if (selectedItem is HamburgerMenuItem item)
            {
                NavView.Header = item.Label;
            }
        }
示例#4
0
        public MainWindow()
        {
            InitializeComponent();

            if (App.RepositoryImageMode)
            {
                Width  = 1280;
                Height = 640;
                NavView.ClearValue(PaddingProperty);
                NavView.ClearValue(HamburgerMenuEx.HeaderTemplateProperty);
                NavViewItems.RemoveAt(NavViewItems.Count - 1);
            }

            UpdateAppTitleBarMargin(NavView);

            NavView.SelectedItem = NavViewItems.OfType <HamburgerMenuItem>().First();
            Navigate(NavView.SelectedItem);
        }