本文整理汇总了C#中Template10.Services.NavigationService.NavigatingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# NavigatingEventArgs类的具体用法?C# NavigatingEventArgs怎么用?C# NavigatingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigatingEventArgs类属于Template10.Services.NavigationService命名空间,在下文中一共展示了NavigatingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatingFromAsync
public Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
if (galleryMetaInfo == null)
BootStrapper.Current.SessionState["GalleryInfo"] = new GalleryMetaInfo { Gallery = Images, SelectedIndex = FlipViewIndex };
else
galleryMetaInfo.SelectedIndex = FlipViewIndex;
return Task.CompletedTask;
}
示例2: OnNavigatingFrom
public override void OnNavigatingFrom(NavigatingEventArgs args)
{
try
{
ApplicationView view = ApplicationView.GetForCurrentView();
view.ExitFullScreenMode();
}
catch (Exception)
{
}
}
示例3: NavigatingFrom
// before navigate (cancellable)
bool NavigatingFrom(bool suspending)
{
var page = FrameFacade.Content as Page;
if (page != null)
{
var dataContext = page.DataContext as INavigable;
if (dataContext != null)
{
var args = new NavigatingEventArgs
{
PageType = FrameFacade.CurrentPageType,
Parameter = FrameFacade.CurrentPageParam,
Suspending = suspending,
};
dataContext.OnNavigatingFrom(args);
return !args.Cancel;
}
}
return true;
}
示例4: FacadeNavigatingCancelEventHandler
private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
{
DebugWrite();
object parameter = null;
try
{
parameter = SerializationService.Deserialize(e.Parameter?.ToString());
}
catch (Exception ex)
{
throw new Exception("Your parameter must be serializable. If it isn't, then use SessionState.", ex);
}
var args = new NavigatingEventArgs(e, Content as Page, parameter);
if (NavigationModeHint != NavigationMode.New)
args.NavigationMode = NavigationModeHint;
NavigationModeHint = NavigationMode.New;
foreach (var handler in _navigatingEventHandlers)
{
handler(this, args);
}
e.Cancel = args.Cancel;
}
示例5: FacadeNavigatingCancelEventHandler
private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
{
DebugWrite();
var parameter = SerializationService.Deserialize(e.Parameter?.ToString());
var args = new NavigatingEventArgs(e, Content as Page, parameter);
if (NavigationModeHint != NavigationMode.New)
args.NavigationMode = NavigationModeHint;
NavigationModeHint = NavigationMode.New;
foreach (var handler in _navigatingEventHandlers)
{
handler(this, args);
}
e.Cancel = args.Cancel;
}
示例6: OnNavigatingFromAsync
public override async Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
await base.OnNavigatingFromAsync(args);
}
示例7: OnNavigatingFrom
public override void OnNavigatingFrom(NavigatingEventArgs args)
{
args.Cancel = false;
}
示例8: OnNavigatingFromAsync
public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
args.Cancel = false;
return Task.CompletedTask;
}
示例9: OnNavigatingFromAsync
public override async Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
args.Cancel = false;
await Task.CompletedTask;
}
示例10: OnNavigatingFromAsync
public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
return base.OnNavigatingFromAsync(args);
}
示例11: FacadeNavigatingCancelEventHandler
private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
{
var args = new NavigatingEventArgs(e, Content as Page);
if (NavigationModeHint != NavigationMode.New)
args.NavigationMode = NavigationModeHint;
NavigationModeHint = NavigationMode.New;
foreach (var handler in _navigatingEventHandlers)
{
handler(this, args);
}
e.Cancel = args.Cancel;
}
示例12: OnNavigatingFrom
public override async void OnNavigatingFrom(NavigatingEventArgs args)
{
await ExecuteSaveCommand();
}
示例13: OnNavigatingFromAsync
public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
_dispatcherTimer.Stop();
return Task.CompletedTask;
}
示例14: NavingFromCancelsAsync
public async Task<bool> NavingFromCancelsAsync(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 false;
}
else if (viewmodel == null)
{
return false;
}
else if (viewmodel is Classic.INavigatingAwareAsync)
{
var deferral = new DeferralManager();
var navigatingEventArgs = new Classic.NavigatingEventArgs(deferral)
{
Page = sourcePage,
PageType = sourcePage?.GetType(),
Parameter = sourceParameter,
NavigationMode = mode,
TargetPageType = targetType,
TargetPageParameter = targetParameter,
Suspending = suspending,
};
try
{
var vm = viewmodel as Classic.INavigatingAwareAsync;
await vm?.OnNavigatingFromAsync(navigatingEventArgs);
await deferral.WaitForDeferralsAsync();
}
catch
{
Debugger.Break();
}
return navigatingEventArgs.Cancel;
}
else if (viewmodel is Portable.IConfirmNavigationAsync)
{
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);
parameters.Add("Suspending", suspending);
var vm = viewmodel as Portable.IConfirmNavigationAsync;
return !await vm?.CanNavigateAsync(parameters);
}
else
{
return true;
}
}
示例15: OnNavigatingFromAsync
public override Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
_beaconManagementService.StopAdvertising();
return base.OnNavigatingFromAsync(args);
}