コード例 #1
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var customerCode = txtCustomerCode.Text;
            var salesOrderId = AddNewSales.Add(customerCode);

            PageFrame.Navigate(new SalesOrderUpdate(salesOrderId));
        }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: fkuner/Manager
        // 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));
        }
コード例 #3
0
 private void OnBackClicked(object sender, RoutedEventArgs e)
 {
     if (PageFrame.CanGoBack)
     {
         PageFrame.GoBack();
     }
 }
コード例 #4
0
        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()
            });
        }
コード例 #5
0
ファイル: MainPage.xaml.cs プロジェクト: gzy20164494/Manager
        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;
                }
            }
        }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
ファイル: MainWindow.xaml.cs プロジェクト: Agere98/Battleship
 private void ParseServerMessage(string message)
 {
     if (message == "start")
     {
         PageFrame.Navigate(new GamePage(client));
     }
 }
コード例 #9
0
 public Menu_System()
 {
     this.InitializeComponent();
     PageFrame.Navigate(typeof(Login_Page));
     PageFrame.Navigated += PageFrame_Navigated;
     SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;
 }
コード例 #10
0
        /// <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);
        }
コード例 #11
0
ファイル: MainWindow.xaml.cs プロジェクト: Agere98/Battleship
 public MainWindow()
 {
     InitializeComponent();
     client = new GameClient();
     client.MessageReceived += Client_MessageReceived;
     PageFrame.Navigate(new MenuPage(client));
 }
コード例 #12
0
        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));
            }
        }
コード例 #13
0
ファイル: Layout.xaml.cs プロジェクト: AndreiSimkin/Kukushka
        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;
        }
コード例 #14
0
        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()
            });
        }
コード例 #15
0
 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);
 }
コード例 #16
0
 private void OnBackRequested(object sender, BackRequestedEventArgs e)
 {
     if (PageFrame.CanGoBack)
     {
         e.Handled = true;
         PageFrame.GoBack();
     }
 }
コード例 #17
0
 private void OnBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
 {
     if (PageFrame.CanGoBack)
     {
         e.Handled = true;
         PageFrame.GoBack();
     }
 }
コード例 #18
0
 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     if (PageFrame.CanGoBack)
     {
         PageFrame.GoBack();
         HomeIcon.IsSelected = true;
     }
 }
コード例 #19
0
 private void OnBackRequested(object sender, BackRequestedEventArgs e)
 {
     if (PageFrame.CanGoBack && Application.Current.Resources.ContainsKey("User"))
     {
         e.Handled = true;
         PageFrame.GoBack();
     }
 }
コード例 #20
0
        private void Level_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var depth = PageFrame.BackStackDepth;

            for (int i = 1; i < depth; i++)
            {
                PageFrame.GoBack();
            }
        }
コード例 #21
0
        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);
        }
コード例 #22
0
 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;
 }
コード例 #23
0
        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);
        }
コード例 #24
0
        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);
        }
コード例 #25
0
 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()
     });
 }
コード例 #26
0
        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()
            });
        }
コード例 #27
0
ファイル: ShellPage.xaml.cs プロジェクト: Lmond/Wecond
        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));
        }
コード例 #28
0
 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);
     }
 }
コード例 #29
0
        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()
            });
        }
コード例 #30
0
 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));
     }
 }