本文整理汇总了C#中Windows.UI.Xaml.Controls.Page.UpdateBindings方法的典型用法代码示例。如果您正苦于以下问题:C# Page.UpdateBindings方法的具体用法?C# Page.UpdateBindings怎么用?C# Page.UpdateBindings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Controls.Page
的用法示例。
在下文中一共展示了Page.UpdateBindings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NavedToAsync
public async Task NavedToAsync(object viewmodel, NavigationMode mode, Page sourcePage, Type sourceType, object sourceParameter, Page targetPage, Type targetType, object targetParameter)
{
Services.NavigationService.NavigationService.DebugWrite();
if (targetPage == null)
{
throw new ArgumentNullException(nameof(targetPage));
}
if (mode == NavigationMode.New)
{
PageState(targetPage).Clear();
}
if (viewmodel == null)
{
return;
}
else if (viewmodel is Classic.INavigatedAwareAsync)
{
var vm = viewmodel as Classic.INavigatedAwareAsync;
await vm?.OnNavigatedToAsync(targetParameter, mode, PageState(targetPage));
}
else if (viewmodel is Portable.INavigatedAware)
{
var parameters = new Portable.NavigationParameters();
parameters.Add("NavigationMode", mode.ToPrismNavigationMode());
parameters.Add("SourceType", sourceType);
parameters.Add("SourceParameter", sourceParameter);
parameters.Add("TargetType", targetType);
parameters.Add("TargetParameter", targetParameter);
var vm = viewmodel as Portable.INavigatedAware;
vm?.OnNavigatedTo(parameters);
}
else if (viewmodel is Portable.INavigatedAwareAsync)
{
var parameters = new Portable.NavigationParameters();
parameters.Add("NavigationMode", mode.ToPrismNavigationMode());
parameters.Add("SourceType", sourceType);
parameters.Add("SourceParameter", sourceParameter);
parameters.Add("TargetType", targetType);
parameters.Add("TargetParameter", targetParameter);
var vm = viewmodel as Portable.INavigatedAwareAsync;
await vm?.OnNavigatedToAsync(parameters);
}
targetPage.InitializeBindings();
targetPage.UpdateBindings();
}