本文整理匯總了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);
}