Esempio n. 1
0
 private void DoMeAFavor_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
 {
     if (args.IsSettingsInvoked)
     {
         HomeFrame.Navigate(typeof(SettingPage));
     }
 }
Esempio n. 2
0
        public MainPage()
        {
            InitializeComponent();
            HomeFrame.Navigate(typeof(MissionHallPage));
            Current = this;
            var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
            var appTitleBar  = ApplicationView.GetForCurrentView().TitleBar;

            coreTitleBar.ExtendViewIntoTitleBar = true;
            appTitleBar.ButtonBackgroundColor   = Colors.Transparent;
        }
Esempio n. 3
0
 public MainPage()
 {
     this.InitializeComponent();
     MainFrame = HomeFrame;
     Window.Current.SetTitleBar(Appbar);
     AppBar = Appbar;
     if (State.CurrentUser == null)
     {
         HomeFrame.Navigate(typeof(LoginView));
     }
     else
     {
         HomeFrame.Navigate(typeof(ChanelView));
     }
 }
Esempio n. 4
0
        private async void Delete_Click(object sender, RoutedEventArgs e)
        {
            var Announcement = await Database.Context.Notes.FirstOrDefaultAsync(m => m.Id == App.thisnote.Id);

            if (Announcement != null)
            {
                Database.Context.Notes.Remove(Announcement);
                await Database.Context.SaveChangesAsync();
            }
            else
            {
                Titlebox.Text = "该笔记不存在";
            }
            HomeFrame.Navigate(typeof(Home));
        }
Esempio n. 5
0
        private void NvSample_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args)
        {
            var tag = (args.SelectedItem as Microsoft.UI.Xaml.Controls.NavigationViewItem)?.Tag?.ToString();

            if (tag != null)
            {
                switch (tag)
                {
                case "Channels":
                    HomeFrame.Navigate(typeof(ChanelView), null, new DrillInNavigationTransitionInfo());
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 6
0
        private async void Save_Click(object sender, RoutedEventArgs e)
        {
            string editorcontent = "";

            Windows.UI.Text.TextGetOptions textGetOptions = new TextGetOptions();
            homeditor.Document.GetText(textGetOptions, out editorcontent);


            var Announcement = await Database.Context.Notes.SingleOrDefaultAsync(m => m.Id == App.thisnote.Id);

            if (Announcement != null)
            {
                Announcement.Title   = Titlebox.Text;
                Announcement.Content = editorcontent;
                await Database.Context.SaveChangesAsync();
            }
            HomeFrame.Navigate(typeof(Home));
        }
Esempio n. 7
0
 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (AddTask.IsSelected)
     {
         HomeFrame.Navigate(typeof(AddTaskPage), null, new SuppressNavigationTransitionInfo());
         if (this.ActualWidth < 700)
         {
             MySplitView.IsPaneOpen = false;
         }
     }
     if (ViewFavTask.IsSelected)
     {
         HomeFrame.Navigate(typeof(ViewMyTaskPage), null, new SuppressNavigationTransitionInfo());
         if (this.ActualWidth < 700)
         {
             MySplitView.IsPaneOpen = false;
         }
     }
     if (ViewTask.IsSelected)
     {
         HomeFrame.Navigate(typeof(ViewUserTask), null, new SuppressNavigationTransitionInfo());
         if (this.ActualWidth < 700)
         {
             MySplitView.IsPaneOpen = false;
         }
     }
     if (EditTask.IsSelected)
     {
         HomeFrame.Navigate(typeof(EditTaskPage), null, new SuppressNavigationTransitionInfo());
         if (this.ActualWidth < 700)
         {
             MySplitView.IsPaneOpen = false;
         }
     }
     else if (Logout.IsSelected)
     {
         App.localSettings.Values["UserLoggedIn"] = null;
         Frame.Navigate(typeof(LoginPage));
     }
 }
Esempio n. 8
0
        private void NavigationView_OnSelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
        {
            NavigationViewItem item =
                args.SelectedItem as NavigationViewItem;
            var viewModel = (HallPageViewModel)DataContext;

            HomeFrame.Navigate(typeof(MissionHallPage));
            switch (item.Tag)
            {
            case "MyPage":
            {
                if (GlobalClass.k != 0)
                {
                    HomeFrame.Navigate(typeof(MyPage));
                    break;
                }
                else
                {
                    HomeFrame.Navigate(typeof(LoginPage));
                    break;
                }
            }

            case "MissionHall":

                HomeFrame.Navigate(typeof(MissionHallPage));
                break;

            case "NoLoginMyPage":
                //HomeFrame.Navigate(typeof(LoginPage));
                break;

            case "MyMoney":
                HomeFrame.Navigate(typeof(MyMoneyPage));
                break;
            }
        }
Esempio n. 9
0
 private void UserPicture_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
 {
     State.CurrentUser = null;
     HomeFrame.Navigate(typeof(LoginView), null, new DrillInNavigationTransitionInfo());
 }
Esempio n. 10
0
 public HomePage()
 {
     this.InitializeComponent();
     HomeFrame.Navigate(typeof(AddTaskPage));
 }
Esempio n. 11
0
 private void HomeButton_Click(object sender, RoutedEventArgs e)
 {
     HomeFrame.Navigate(typeof(Page1));
 }
Esempio n. 12
0
        public MainPage()
        {
            this.InitializeComponent();

            HomeFrame.Navigate(typeof(Page1));
        }