private void btnAdd_Click(object sender, RoutedEventArgs e) { var customerCode = txtCustomerCode.Text; var salesOrderId = AddNewSales.Add(customerCode); PageFrame.Navigate(new SalesOrderUpdate(salesOrderId)); }
// MainPage.xaml.cs //public Microsoft.UI.Xaml.Controls.NavigationView NavigationView => NavView; public MainPage() { this.InitializeComponent(); Messenger.Default.Register <PropertyChangedMessage <string> >(this, message => { TodoItemService todoItemService = new TodoItemService(); if (message.PropertyName == MoneyPageViewModel.PropertyName) { if (message.OldValue != message.NewValue && message.OldValue != null && message.NewValue != null) { double num = Convert.ToDouble(message.NewValue.Substring(message.NewValue.IndexOf(':') + 1)); double num2 = MoneyPageViewModel._maxConsume; if (MoneyPageViewModel._maxConsume - num <= MoneyPageViewModel._difference) { TodoItem item = new TodoItem(); item.Content = "当前距离消费限额仅剩:" + (MoneyPageViewModel._maxConsume - num).ToString() + "元"; item.DateCreated = DateTime.Now; todoItemService.AddAsync(item); } } } }); PageFrame.Navigate(typeof(MemoPage)); }
private void OnBackClicked(object sender, RoutedEventArgs e) { if (PageFrame.CanGoBack) { PageFrame.GoBack(); } }
public PageResult <Event> GetEvents([FromQuery] PageFrame pageFrame, [FromQuery] DateTime?beginDate, [FromQuery] DateTime?endDate) { var query = from e in context.Events.Include(e => e.EventPartners) orderby e.BeginDate descending select e; if (beginDate != null) { query = from e in query where beginDate <= e.BeginDate orderby e.BeginDate descending select e; } if (endDate != null) { query = from e in query where endDate >= e.BeginDate orderby e.BeginDate descending select e; } return(new PageResult <Event> { Data = new PageFrameDb <Event>().FrameDb(query, pageFrame).ToList(), TotalCount = query.Count() }); }
private void NvSample_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { if (args.IsSettingsSelected) { PageFrame.Navigate(typeof(BlankPage1)); } else { NavigationViewItem item = args.SelectedItem as NavigationViewItem; switch (item.Tag) { case "BlankPage1": PageFrame.Navigate(typeof(BlankPage1)); break; case "BlankPage2": PageFrame.Navigate(typeof(BlankPage2)); break; case "BlankPage3": PageFrame.Navigate(typeof(BlankPage3)); break; } } }
private void NavigationViewStewardMenu_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { NavigationViewItem item = args.SelectedItem as NavigationViewItem; switch (item.Tag.ToString()) { case "ChangeSeatsView": PageFrame.Navigate(typeof(ChangeSeatsView)); break; case "OrdersOverview": PageFrame.Navigate(typeof(OrdersOverview)); break; case "DiscountView": PageFrame.Navigate(typeof(DiscountView)); break; case "Notification": PageFrame.Navigate(typeof(SendAnnouncementView)); break; case "Logout": Frame.Navigate(typeof(MainPage)); ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; localSettings.Values["Token"] = string.Empty; break; } }
/// <summary> /// Navigates the specified page. /// </summary> /// <param name="page">The page.</param> internal Task Navigate(FrameworkElement page) { _logger.Debug("Navigating to " + page.GetType().Name); var task = new TaskCompletionSource <bool>(); Dispatcher.InvokeAsync(async() => { var current = CurrentPage; await PageFrame.NavigateWithTransition(page); task.TrySetResult(true); _logger.Debug("Navigation complete to " + page.GetType().Name); EventHelper.FireEventIfNotNull(Navigated, this, new NavigationEventArgs { NewPage = page, OldPage = current }, _logger); Task.Run(() => { GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); }); }); return(task.Task); }
private void ParseServerMessage(string message) { if (message == "start") { PageFrame.Navigate(new GamePage(client)); } }
public Menu_System() { this.InitializeComponent(); PageFrame.Navigate(typeof(Login_Page)); PageFrame.Navigated += PageFrame_Navigated; SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; }
/// <summary> /// Navigates the back. /// </summary> internal Task NavigateBack() { var task = new TaskCompletionSource <bool>(); Dispatcher.InvokeAsync(async() => { if (PageFrame.NavigationService.CanGoBack) { var current = CurrentPage; await PageFrame.GoBackWithTransition(); EventHelper.FireEventIfNotNull(Navigated, this, new NavigationEventArgs { NewPage = CurrentPage, OldPage = current }, _logger); } else { //Check for home page and call system options modal var homePage = CurrentPage as IHomePage; if (homePage != null) { NavigationManager.NavigateToBackModal(); } } task.TrySetResult(true); }); return(task.Task); }
public MainWindow() { InitializeComponent(); client = new GameClient(); client.MessageReceived += Client_MessageReceived; PageFrame.Navigate(new MenuPage(client)); }
private void SplitViewMenuList_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (CreateQuestionListBoxitem.IsSelected) { PageFrame.Navigate(typeof(CreateQuestion), _teacher); TitleTextblock.Text = "Skapa fråga"; } else if (CreateExamListBoxitem.IsSelected) { PageFrame.Navigate(typeof(CreateExam), _teacher); TitleTextblock.Text = "Skapa prov"; } else if (HomeListBoxItem.IsSelected) { PageFrame.Navigate(typeof(TeacherOverview), _teacher); TitleTextblock.Text = "Välkommen"; } else if (CorrectExamListBoxItem.IsSelected) { PageFrame.Navigate(typeof(CorrectExam)); TitleTextblock.Text = "Rätta prov"; } else if (ExitListBoxitem.IsSelected) { _teacher = null; this.Frame.Navigate(typeof(MainPage)); } }
private void PageFrame_Navigating(object sender, NavigatingCancelEventArgs e) { if (start > 0) { start--; return; } if (Content != null && !_allowDirectNavigation) { e.Cancel = true; _navArgs = e; DoubleAnimation animation0 = new DoubleAnimation(); animation0.EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseOut, Exponent = 1 }; animation0.From = 1; animation0.To = 0; animation0.Duration = _duration; animation0.Completed += SlideCompleted; PageFrame.BeginAnimation(OpacityProperty, animation0); } _allowDirectNavigation = false; }
public PageResult <Partner> GetPartners([FromQuery] PageFrame pageFrame, [FromQuery] string[] tags) { if (tags.Length == 0) { var q = from p in context.Partners.Include(p => p.EventPartners).Include(p => p.TagPartners) select p; return(new PageResult <Partner> { Data = new PageFrameDb <Partner>().FrameDb(q, pageFrame).ToList(), TotalCount = context.Partners.Count() }); } var query = from p in context.Partners.Include(p => p.EventPartners).Include(p => p.TagPartners) join tp in context.TagPartners on p.Id equals tp.PartnerId join t in context.Tags on tp.TagId equals t.Id where tags.Contains(t.Name) select p; return(new PageResult <Partner> { Data = new PageFrameDb <Partner>().FrameDb(query, pageFrame).ToList(), TotalCount = query.Count() }); }
private void MessagesButton_Checked(object sender, RoutedEventArgs e) { TableTabButton.IsChecked = true; ChangeTab(MessagesButton, GamesButton, AccountsButton); DataGridTable.ItemsSource = Global.DB.TextMessages.ToList(); SetDGColumns(MessagesDGColumns); PageFrame.Navigate(MessagesPage); }
private void OnBackRequested(object sender, BackRequestedEventArgs e) { if (PageFrame.CanGoBack) { e.Handled = true; PageFrame.GoBack(); } }
private void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e) { if (PageFrame.CanGoBack) { e.Handled = true; PageFrame.GoBack(); } }
private void BackButton_Click(object sender, RoutedEventArgs e) { if (PageFrame.CanGoBack) { PageFrame.GoBack(); HomeIcon.IsSelected = true; } }
private void OnBackRequested(object sender, BackRequestedEventArgs e) { if (PageFrame.CanGoBack && Application.Current.Resources.ContainsKey("User")) { e.Handled = true; PageFrame.GoBack(); } }
private void Level_Tapped(object sender, TappedRoutedEventArgs e) { var depth = PageFrame.BackStackDepth; for (int i = 1; i < depth; i++) { PageFrame.GoBack(); } }
private void RepoSettingsButtonClick(object sender, RoutedEventArgs e) { RepoSettingsViewModel dataContext = RepoSettingsPage.DataContext as RepoSettingsViewModel; dataContext.DatabaseSolutionPath = ConfigurationManager.AppSettings["DatabaseSolutionPath"]; //((RepoSettingsViewModel)page.DataContext).DatabaseSolutionPath //CurrentMenuStackPanel = EditScriptMenuStackPanel; PageFrame.Navigate(RepoSettingsPage); }
public Menu_System() { this.InitializeComponent(); ApplicationView.PreferredLaunchViewSize = new Size(450, 650); ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; PageFrame.Navigate(typeof(Login_Page)); PageFrame.Navigated += PageFrame_Navigated; SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; }
private void EditStaticDataScriptsButtonClick(object sender, RoutedEventArgs e) { //_editStaticDataScriptsViewModel.DatabaseSolutionDirectoryPath = @"C:\Source\Repo\Database\DatabaseSolutionDirectory"; EditStaticDataScriptsViewModel dataContext = EditStaticDataScriptsPage.DataContext as EditStaticDataScriptsViewModel; dataContext.DatabaseSolutionDirectoryPath = ConfigurationManager.AppSettings["DatabaseSolutionPath"]; dataContext.StaticDataEnabled = true; PageFrame.Navigate(EditStaticDataScriptsPage); }
public void NavigateToPage(AppMenuItemType type, object parameter = null, bool isBack = false) { if (PageSplitView.DisplayMode == SplitViewDisplayMode.CompactOverlay) { IsSubPageOpen = false; } var last = MainFrameHistoryList.LastOrDefault(); var page = GetPageTypeFromMenuType(type); bool isRepeat = false; if (last != null && last.Item1 == page && last.Item2 == parameter) { isRepeat = true; } if (page != null) { App.AppViewModel.CurrentPageType = page; NavigationTransitionInfo transitionInfo = null; if (type == AppMenuItemType.VideoPlayer || !App.AppViewModel.IsEnableAnimation) { transitionInfo = new SuppressNavigationTransitionInfo(); } else { if (isBack) { transitionInfo = new EntranceNavigationTransitionInfo(); } else { transitionInfo = new DrillInNavigationTransitionInfo(); } } PageFrame.Navigate(page, parameter, transitionInfo); if (!isBack) { if (page.Equals(typeof(Pages.Main.VideoPage)) || page.Equals(typeof(Pages.Main.BangumiPage))) { MainFrameHistoryList.RemoveAll(p => p.Item1 == page); } if (!isRepeat) { MainFrameHistoryList.Add(new Tuple <Type, object>(page, parameter)); } if (MainFrameHistoryList.Count > 1) { BackButton.Visibility = Visibility.Visible; } } IsDefault = false; } else { IsDefault = true; } PageFrame.Focus(FocusState.Programmatic); }
public PageResult <UserResponse> GetUsers([FromQuery] PageFrame pageFrame) { return(new PageResult <UserResponse> { Data = Mapper.Map <List <UserResponse> >( new PageFrameDb <User>().FrameDb(context.Users.AsQueryable(), pageFrame).ToList()), TotalCount = context.Users.Count() }); }
public PageResult <Tag> GetTags([FromQuery] PageFrame pageFrame) { var q = context.Tags.Include(c => c.TagPartners); return(new PageResult <Tag> { Data = new PageFrameDb <Tag>().FrameDb(q, pageFrame).ToList(), TotalCount = q.Count() }); }
private void ReloadApp_Click(object sender, RoutedEventArgs e) { Frame PageFrame = Window.Current.Content as Frame; if (PageFrame == null) { PageFrame = new Frame(); } PageFrame.Navigate(typeof(ShellPage)); }
private void AppTitleBar_Loaded(object sender, RoutedEventArgs e) { SetTitleBar(AppTitleBar); // TODO Raname MainPage in case your app Main Page has a different name PageFrame.Navigate(typeof(MainPage)); if (AppWindowTitleBar.IsCustomizationSupported()) { SetDragRegionForCustomTitleBar(m_AppWindow); } }
public PageResult <Contact> GetContacts([FromQuery] PageFrame pageFrame) { var q = context.Contacts.Include(c => c.ContactEmail).Include(c => c.ContactPhone); return(new PageResult <Contact> { Data = new PageFrameDb <Contact>().FrameDb(q, pageFrame).ToList(), TotalCount = q.Count() }); }
private void ContactsButton_Click(object sender, RoutedEventArgs e) { if (Application.Current.Resources.ContainsKey("User")) { PageFrame.Navigate(typeof(Contacts_Page)); } else { PageFrame.Navigate(typeof(Login_Page)); } }