本文整理汇总了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;
}
示例2: NavigatingEventArgs
public NavigatingEventArgs(NavigatingCancelEventArgs e, Page page)
{
this.Page = page;
this.NavigationMode = e.NavigationMode;
this.PageType = e.SourcePageType;
this.Parameter = e.Parameter?.ToString();
}
示例3: NavigatedEventArgs
public NavigatedEventArgs(NavigationEventArgs e, Page page)
{
this.Page = page;
this.PageType = e.SourcePageType;
this.Parameter = e.Parameter;
this.NavigationMode = e.NavigationMode;
}
示例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;
};
}
示例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();
}
}
示例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
};
}
示例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;
}
示例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;
}
示例9: NavigatingEventArgs
public NavigatingEventArgs(DeferralManager manager, NavigatingCancelEventArgs e, Page page, object parameter) : this(manager)
{
NavigationMode = e.NavigationMode;
PageType = e.SourcePageType;
Page = page;
Parameter = parameter;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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
};
}
示例14: TabSelectedEventArgs
public TabSelectedEventArgs(Page tab)
{
if (tab == null)
throw new ArgumentNullException("tab");
Tab = tab;
}
示例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
};
}