Example #1
0
        async void ShowLogin()
        {
            MessageDialog message = new MessageDialog();
            var           res     = await message.ShowAsync();

            if (res == ContentDialogResult.Secondary)
            {
                Application.Current.Exit();
            }
            else if (res == ContentDialogResult.Primary)
            {
                if (await message.IsLogin())
                {
                    this.InitializeComponent();
                    HomeView home = new HomeView();
                    FrameMain.Navigate(home.GetType());
                }
                else
                {
                    ContentDialog Error = new ContentDialog();
                    Error.Title = "Sai mật khẩu";
                    Error.SecondaryButtonText = "OK";
                    var contentResult = await Error.ShowAsync();

                    if (contentResult == ContentDialogResult.Secondary)
                    {
                        ShowLogin();
                    }
                }
            }
        }
Example #2
0
        private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
        {
            string item = ((NavigationViewItem)args.SelectedItem).Tag as string;

            if (item == "StudentView")
            {
                StudentView student = new StudentView();
                FrameMain.Navigate(student.GetType());
            }
            else if (item == "HomeView")
            {
                HomeView home = new HomeView();
                FrameMain.Navigate(home.GetType());
            }
            else if (item == "ScoreView")
            {
                ScoreView score = new ScoreView();
                FrameMain.Navigate(score.GetType());
            }
        }