本文整理汇总了C#中Windows.UI.Xaml.Controls.Page类的典型用法代码示例。如果您正苦于以下问题:C# Page类的具体用法?C# Page怎么用?C# Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Page类属于Windows.UI.Xaml.Controls命名空间,在下文中一共展示了Page类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: OnResume
/// <summary>
/// Возобновление.
/// </summary>
/// <param name="sender">Страница.</param>
/// <param name="o">Объект.</param>
protected async override void OnResume(Page sender, object o)
{
if (StatusBarHelper.IsStatusBarPresent)
{
await StatusBarHelper.StatusBar.ProgressIndicator.HideAsync();
}
}
开发者ID:Opiumtm,项目名称:DvachBrowser3,代码行数:12,代码来源:NoStatusBarProgressPageService.cs
示例17: RegisterBackKey
/// <summary>Call this method in Loaded event as the event will be automatically
/// deregistered when the FrameworkElement has been unloaded. </summary>
public static void RegisterBackKey(Page page)
{
var callback = new TypedEventHandler<CoreDispatcher, AcceleratorKeyEventArgs>(
delegate(CoreDispatcher sender, AcceleratorKeyEventArgs args)
{
if (!args.Handled && args.VirtualKey == VirtualKey.Back &&
(args.EventType == CoreAcceleratorKeyEventType.KeyDown ||
args.EventType == CoreAcceleratorKeyEventType.SystemKeyDown))
{
var element = FocusManager.GetFocusedElement();
if (element is FrameworkElement && PopupHelper.IsInPopup((FrameworkElement)element))
return;
if (element is TextBox || element is PasswordBox || element is WebView)
return;
if (page.Frame.CanGoBack)
{
args.Handled = true;
page.Frame.GoBack();
}
}
});
page.Dispatcher.AcceleratorKeyActivated += callback;
SingleEvent.RegisterEvent(page,
(p, h) => p.Unloaded += h,
(p, h) => p.Unloaded -= h,
(o, a) => { page.Dispatcher.AcceleratorKeyActivated -= callback; });
}
开发者ID:RareNCool,项目名称:MyToolkit,代码行数:33,代码来源:PageUtilities.cs
示例18: NavedFromAsync
public async Task NavedFromAsync(object viewmodel, NavigationMode mode, Page sourcePage, Type sourceType, object sourceParameter, Page targetPage, Type targetType, object targetParameter, bool suspending)
{
Services.NavigationService.NavigationService.DebugWrite();
if (sourcePage == null)
{
return;
}
else if (viewmodel == null)
{
return;
}
else if (viewmodel is Classic.INavigatedAwareAsync)
{
var vm = viewmodel as Classic.INavigatedAwareAsync;
await vm?.OnNavigatedFromAsync(PageState(sourcePage), suspending);
}
else if (viewmodel is Portable.INavigatedAware)
{
var vm = viewmodel as Portable.INavigatedAware;
var parameters = new Portable.NavigationParameters();
vm?.OnNavigatedFrom(parameters);
}
else if (viewmodel is Portable.INavigatedAwareAsync)
{
var vm = viewmodel as Portable.INavigatedAwareAsync;
var parameters = new Portable.NavigationParameters();
await vm?.OnNavigatedFromAsync(parameters);
}
}
开发者ID:GFlisch,项目名称:Template10,代码行数:30,代码来源:NavigationLogic.cs
示例19: SetPage
public void SetPage(Page page)
{
NavigationService.Current.NavigationModel.Push(page, null);
SetCurrentPage(page);
page.NavigationProxy.Inner = NavigationService.Current;
}
开发者ID:DIGIHOME-MK,项目名称:Xamarin-forms-winrt,代码行数:7,代码来源:Platform.cs
示例20: CriarAba
public async void CriarAba(Page page, string titulo)
{
try
{
var aba = new AbaDado
{
titulo = titulo,
pagina = page,
};
listaAbas.Add(aba);
abasListView.SelectedItem = aba;
TotalAbas = listaAbas.Count;
}
catch (Exception ex)
{
MessageDialog dialog = new MessageDialog(
"Dificuldade ao criar aba\n\nERRO:" + ex.Message, "Dificuldade");
await dialog.ShowAsync();
}
}
开发者ID:obritto,项目名称:tabAbaApp,代码行数:27,代码来源:MainPage.xaml.cs
注:本文中的Windows.UI.Xaml.Controls.Page类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论