當前位置: 首頁>>代碼示例>>C#>>正文


C# Controls.Page類代碼示例

本文整理匯總了C#中Windows.UI.Xaml.Controls.Page的典型用法代碼示例。如果您正苦於以下問題:C# Page類的具體用法?C# Page怎麽用?C# Page使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Page類屬於Windows.UI.Xaml.Controls命名空間,在下文中一共展示了Page類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: NavigatingEventArgs

 public NavigatingEventArgs(NavigatingCancelEventArgs e, Page page)
 {
     NavigationMode = e.NavigationMode;
     PageType = e.SourcePageType;
     Parameter = e.Parameter;
     Page = page;
 }
開發者ID:DarthPedro,項目名稱:Template10,代碼行數:7,代碼來源:NavigatingEventArgs.cs

示例2: NavigatingEventArgs

 public NavigatingEventArgs(NavigatingCancelEventArgs e, Page page)
 {
     this.Page = page;
     this.NavigationMode = e.NavigationMode;
     this.PageType = e.SourcePageType;
     this.Parameter = e.Parameter?.ToString();
 }
開發者ID:haroldma,項目名稱:Audiotica,代碼行數:7,代碼來源:NavigatingEventArgs.cs

示例3: NavigatedEventArgs

 public NavigatedEventArgs(NavigationEventArgs e, Page page)
 {
     this.Page = page;
     this.PageType = e.SourcePageType;
     this.Parameter = e.Parameter;
     this.NavigationMode = e.NavigationMode;
 }
開發者ID:haroldma,項目名稱:Audiotica,代碼行數:7,代碼來源:NavigatedEventArgs.cs

示例4: NavigationHelper

        /// <summary>
        /// 初始化 <see cref="NavigationHelper"/> 類的新實例。
        /// </summary>
        /// <param name="page">對當前頁麵的引用,用於導航。 
        /// 此引用可操縱幀,並確保
        /// 僅在頁麵占用整個窗口時產生導航請求。</param>
        public NavigationHelper(Page page)
        {
            this.Page = page;

            // 當此頁是可視化樹的一部分時,進行兩個更改: 
            // 1) 將應用程序視圖狀態映射到頁的可視狀態
            // 2) 處理鍵盤和鼠標導航請求
            this.Page.Loaded += (sender, e) =>
            {
                // 僅當占用整個窗口時,鍵盤和鼠標導航才適用
                if (this.Page.ActualHeight == Window.Current.Bounds.Height &&
                    this.Page.ActualWidth == Window.Current.Bounds.Width)
                {
                    // 直接偵聽窗口,因此無需焦點
                    Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
                        CoreDispatcher_AcceleratorKeyActivated;
                    Window.Current.CoreWindow.PointerPressed +=
                        this.CoreWindow_PointerPressed;
                }
            };

            // 當頁不再可見時,撤消相同更改
            this.Page.Unloaded += (sender, e) =>
            {
                Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated -=
                    CoreDispatcher_AcceleratorKeyActivated;
                Window.Current.CoreWindow.PointerPressed -=
                    this.CoreWindow_PointerPressed;
            };
        }
開發者ID:KimLogan,項目名稱:ZhangShangZhongDong-win8,代碼行數:36,代碼來源:NavigationHelper.cs

示例5: OnNavigatedTo

 /// <summary>
 /// Произошёл заход на страницу.
 /// </summary>
 /// <param name="sender">Страница.</param>
 /// <param name="e">Событие.</param>
 protected override async void OnNavigatedTo(Page sender, NavigationEventArgs e)
 {
     if (StatusBarHelper.IsStatusBarPresent)
     {
         await StatusBarHelper.StatusBar.ProgressIndicator.HideAsync();
     }
 }
開發者ID:Opiumtm,項目名稱:DvachBrowser3,代碼行數:12,代碼來源:NoStatusBarProgressPageService.cs

示例6: NavigationHelper

        /// <summary>
        /// Initializes a new instance of the <see cref="NavigationHelper"/> class.
        /// </summary>
        /// <param name="page">A reference to the current page used for navigation.  
        /// This reference allows for frame manipulation and to ensure that keyboard 
        /// navigation requests only occur when the page is occupying the entire window.</param>
        public NavigationHelper(Page page) {
            this.Page = page;

            // When this page is part of the visual tree make two changes:
            // 1) Map application view state to visual state for the page
            // 2) Handle hardware navigation requests
            this.Page.Loaded += (sender, e) => {
#if WINDOWS_PHONE_APP
                Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
#else
                // Keyboard and mouse navigation only apply when occupying the entire window
                if (this.Page.ActualHeight == Window.Current.Bounds.Height &&
                    this.Page.ActualWidth == Window.Current.Bounds.Width) {
                    // Listen to the window directly so focus isn't required
                    Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
                        CoreDispatcher_AcceleratorKeyActivated;
                    Window.Current.CoreWindow.PointerPressed +=
                        this.CoreWindow_PointerPressed;
                }
#endif
            };

            // Undo the same changes when the page is no longer visible
            this.Page.Unloaded += (sender, e) => {
#if WINDOWS_PHONE_APP
                Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
#else
                Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated -=
                    CoreDispatcher_AcceleratorKeyActivated;
                Window.Current.CoreWindow.PointerPressed -=
                    this.CoreWindow_PointerPressed;
#endif
            };
        }
開發者ID:zeljkom,項目名稱:nn,代碼行數:40,代碼來源:NavigationHelper.cs

示例7: Restore

 static public void Restore(Page inputFrame)
 {
     // Set authentication fields.
     (inputFrame.FindName("ServiceAddressField") as TextBox).Text = baseUri;
     (inputFrame.FindName("UserNameField") as TextBox).Text = user;
     (inputFrame.FindName("PasswordField") as PasswordBox).Password = password;
 }
開發者ID:mbin,項目名稱:Win81App,代碼行數:7,代碼來源:Common.cs

示例8: Save

 static public void Save(Page inputFrame)
 {
     // Keep values of authentication fields.
     baseUri = (inputFrame.FindName("ServiceAddressField") as TextBox).Text;
     user = (inputFrame.FindName("UserNameField") as TextBox).Text;
     password = (inputFrame.FindName("PasswordField") as PasswordBox).Password;
 }
開發者ID:mbin,項目名稱:Win81App,代碼行數:7,代碼來源:Common.cs

示例9: NavigatingEventArgs

 public NavigatingEventArgs(DeferralManager manager, NavigatingCancelEventArgs e, Page page, object parameter) : this(manager)
 {
     NavigationMode = e.NavigationMode;
     PageType = e.SourcePageType;
     Page = page;
     Parameter = parameter;
 }
開發者ID:Rasetech,項目名稱:Template10,代碼行數:7,代碼來源:NavigatingEventArgs.cs

示例10: Start

        public async Task<AppHubViewModel> Start(Page page)
        {
            this.Page = page;
            UpgradeLicense = await new InAppPurchaseHelper("HideAds").Setup();

            LoadData_Runtime();
            this.PropertyChanged += async (s, e) =>
            {
                if (e.PropertyName.Equals("Selected") && this.Selected != null)
                {
                    if (this.Selected is AdvertRecord)
                        await new Windows.UI.Popups.MessageDialog("Advertisement!").ShowAsync();
                    else
                        Services.Navigation.GotoDetail(this.Selected.Id);
                    this.Selected = null;
                }
            };

            UpgradeLicense.LicenseChanged += async (s, e) =>
            {
                if (UpgradeLicense.IsPurchased)
                {
                    await page.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                     {
                         // remove advertisements (if any)
                         foreach (var parent in Groups4Landscape.Union(Groups4Portrait.Union(Groups4Snapview)).Where(x => x.Children.Any(y => y is AdvertRecord)))
                         {
                             foreach (var advert in parent.Children.Where(x => x is AdvertRecord).ToArray())
                                 parent.Children.Remove(advert);
                         }
                     });
                }
            };
            return this;
        }
開發者ID:noriike,項目名稱:xaml-106136,代碼行數:35,代碼來源:AppHubViewModel.cs

示例11: Show

        /// <summary>
        /// Will hide application bar if current page reference is passged
        /// If you don't want that, pass null
        /// </summary>
        /// <param name="valueofoverlay"></param>
        /// <param name="basePage"></param>
        public void Show(string valueofoverlay, Page basePage)
        {
            if (basePage != null)
            {
                _basePage = basePage;
                if (_basePage != null && _basePage.BottomAppBar != null)
                    _basePage.BottomAppBar.IsOpen = false;
            }
            this.textBlockStatus.Text = valueofoverlay;
            if (this.ChildWindowPopup == null)
            {
                this.ChildWindowPopup = new Popup();

                try
                {
                    this.ChildWindowPopup.Child = this;
                }
                catch (ArgumentException)
                {
                    throw new InvalidOperationException("The control is already shown.");
                }
            }

            if (this.ChildWindowPopup != null)
            {
                // Show popup
                this.ChildWindowPopup.IsOpen = true;
            }
        }
開發者ID:maskaravivek,項目名稱:FoodMenu,代碼行數:35,代碼來源:OverlayProgressBar.xaml.cs

示例12: AddBottomAppBar

        public static void AddBottomAppBar(Page myPage)
        {
            var commandBar = new CommandBar();
            var searchButton = new AppBarButton
            {
                Label = "Поиск",
                Icon = new SymbolIcon(Symbol.Find),
            };

            var aboutButton = new AppBarButton
            {
                Label = "О прилож.",
                Icon = new SymbolIcon(Symbol.Help),
            };

            if (RootFrame != null)
            {
                searchButton.Click += SearchButtonClick;
                aboutButton.Click += AboutButtonClick;
            }

            commandBar.PrimaryCommands.Add(searchButton);
            commandBar.PrimaryCommands.Add(aboutButton);
            myPage.BottomAppBar = commandBar;
        }
開發者ID:nastachka,項目名稱:pdd,代碼行數:25,代碼來源:LayoutObjectFactory.cs

示例13: NavigationHelper

        public NavigationHelper(Page page)
        {
            this.Page = page;

            this.Page.Loaded += (sender, e) => {
            #if WINDOWS_PHONE_APP
                Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
            #else
                // Keyboard and mouse navigation only apply when occupying the entire window
                if (this.Page.ActualHeight == Window.Current.Bounds.Height &&
                    this.Page.ActualWidth == Window.Current.Bounds.Width) {
                    // Listen to the window directly so focus isn't required
                    Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
                        CoreDispatcher_AcceleratorKeyActivated;
                    Window.Current.CoreWindow.PointerPressed +=
                        this.CoreWindow_PointerPressed;
                }
            #endif
            };

            this.Page.Unloaded += (sender, e) => {
            #if WINDOWS_PHONE_APP
                Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
            #else
                Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated -=
                    CoreDispatcher_AcceleratorKeyActivated;
                Window.Current.CoreWindow.PointerPressed -=
                    this.CoreWindow_PointerPressed;
            #endif
            };
        }
開發者ID:EmilyWatsonCF,項目名稱:CalculationHelper,代碼行數:31,代碼來源:NavigationHelper.cs

示例14: TabSelectedEventArgs

		public TabSelectedEventArgs(Page tab)
		{
			if (tab == null)
				throw new ArgumentNullException("tab");

			Tab = tab;
		}
開發者ID:Costo,項目名稱:Xamarin.Forms,代碼行數:7,代碼來源:TabsControl.cs

示例15: NavigationHelper

        public NavigationHelper(Page page)
        {
            if (page == null) throw new ArgumentNullException(nameof(page));

            mPage = page;
            mPage.Loaded += (sender, e) =>
            {
            #if WINDOWS_PHONE_APP
                HardwareButtons.BackPressed += OnHardwareButtonBackPressed;
            #else
                if (mPage.ActualHeight == Window.Current.Bounds.Height && mPage.ActualWidth == Window.Current.Bounds.Width)
                {
                    Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated += OnAcceleratorKeyActivated;
                    Window.Current.CoreWindow.PointerPressed += OnPointerPressed;
                }
            #endif
            };

            mPage.Unloaded += (sender, e) =>
            {
            #if WINDOWS_PHONE_APP
                HardwareButtons.BackPressed -= OnHardwareButtonBackPressed;
            #else
                Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated -= OnAcceleratorKeyActivated;
                Window.Current.CoreWindow.PointerPressed -= OnPointerPressed;
            #endif
            };
        }
開發者ID:xyrus02,項目名稱:mfat-client,代碼行數:28,代碼來源:NavigationHelper.cs


注:本文中的Windows.UI.Xaml.Controls.Page類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。