本文整理汇总了C#中NavigationMode类的典型用法代码示例。如果您正苦于以下问题:C# NavigationMode类的具体用法?C# NavigationMode怎么用?C# NavigationMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationMode类属于命名空间,在下文中一共展示了NavigationMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: NavigatingCancelEventArgs
public NavigatingCancelEventArgs(IViewMappingItem mapping, NavigationMode navigationMode, string parameter)
{
_mapping = mapping;
_navigationMode = navigationMode;
_parameter = parameter;
_isCancelable = true;
}
示例3: MovementBasedLogicTile
protected MovementBasedLogicTile(Int32[] levels, Int32[] rows, Int32[] columns, NavigationMode[] navigationModes,
Action<MapCharacter, SpriteDirection> onEntering, Action<MapCharacter, SpriteDirection> onLeaving)
: base(levels, rows, columns, navigationModes)
{
OnEntering = onEntering;
OnLeaving = onLeaving;
}
示例4: OnNavigatedToAsync
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
if (state.ContainsKey(nameof(this.FeaturedShows)))
{
this.FeaturedShows = state[nameof(this.FeaturedShows)] as ObservableCollection<Show>;
}
if (state.ContainsKey(nameof(this.NewReleaseShows)))
{
this.NewReleaseShows = state[nameof(this.NewReleaseShows)] as ObservableCollection<Show>;
}
state.Clear();
if (this._dataAcquired)
{
await Task.Yield();
return;
}
this.RetrieveFeaturedShows();
this.RetrieveOtherShows();
this._dataAcquired = true;
}
示例5: OnNavigatedToAsync
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
_statisticsService.RegisterPage("LoginView");
var sessionId = _appSettings.Get<string>(StorageKey.SessionId);
var expiration = _appSettings.Get<DateTime>(StorageKey.SessionExpiration);
var username = _appSettings.Get<string>(StorageKey.Username);
var password = _appSettings.Get<string>(StorageKey.Password);
Username = username;
Password = password;
RememberMe = true;
if (string.IsNullOrWhiteSpace(sessionId) == false)
{
if (expiration > DateTime.Now)
NavigationService.Navigate(typeof(HomeView));
else
{
if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password))
return;
RememberMe = true;
await Login();
}
}
}
示例6: NavigateTo
void NavigateTo(NavigationMode mode, string parameter)
{
LastNavigationParameter = parameter;
LastNavigationType = FrameFacade.Content.GetType().FullName;
if (mode == NavigationMode.New)
{
FrameFacade.ClearFrameState();
}
var page = FrameFacade.Content as Page;
if (page != null)
{
// call viewmodel
var dataContext = page.DataContext as INavigable;
if (dataContext != null)
{
if (dataContext.Identifier != null
&& (mode == NavigationMode.Forward || mode == NavigationMode.Back))
{
// don't call load if cached && navigating back/forward
return;
}
else
{
// prepare for state load
dataContext.NavigationService = this;
var pageState = FrameFacade.PageStateContainer(page.GetType());
dataContext.OnNavigatedTo(parameter, mode, pageState);
}
}
}
}
示例7: OnNavigatedTo
public override async void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewState)
{
if (viewState != null)
{
base.OnNavigatedTo(navigationParameter, navigationMode, viewState);
if (navigationMode == NavigationMode.Refresh)
{
// Restore the errors collection manually
var errorsCollection = RetrieveEntityStateValue<IDictionary<string, ReadOnlyCollection<string>>>("errorsCollection", viewState);
if (errorsCollection != null)
{
_paymentMethod.SetAllErrors(errorsCollection);
}
}
}
if (navigationMode == NavigationMode.New)
{
var defaultPaymentMethod = await _checkoutDataRepository.GetDefaultPaymentMethodAsync();
if (defaultPaymentMethod != null)
{
// Update the information and validate the values
PaymentMethod.CardNumber = defaultPaymentMethod.CardNumber;
PaymentMethod.CardVerificationCode = defaultPaymentMethod.CardVerificationCode;
PaymentMethod.CardholderName = defaultPaymentMethod.CardholderName;
PaymentMethod.ExpirationMonth = defaultPaymentMethod.ExpirationMonth;
PaymentMethod.ExpirationYear = defaultPaymentMethod.ExpirationYear;
PaymentMethod.Phone = defaultPaymentMethod.Phone;
ValidateForm();
}
}
}
示例8: NavigatingCancelEventArgs
public NavigatingCancelEventArgs(Type pageType, NavigationMode mode, bool isCancelable, bool isNavigationInitiator)
{
this.SourcePageType = pageType;
this.NavigationMode = mode;
this.IsCancelable = isCancelable;
this.IsNavigationInitiator = isNavigationInitiator;
}
示例9: OnNavigatedTo
public override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
{
if (navigationParameter != null)
{
SelectedNews = navigationParameter as News;
}
}
示例10: OnNavigatedTo
public override void OnNavigatedTo(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
base.OnNavigatedTo(parameter, mode, state);
Messages = _messageService.GetMessages();
Selected = Messages.First();
}
示例11: GetDeactivateEvent
private DeactivateEvent GetDeactivateEvent(NavigationMode mode)
{
if (mode == NavigationMode.Back) return DeactivateEvent.Back;
if (mode == NavigationMode.Forward) return DeactivateEvent.Forward;
return DeactivateEvent.Default;
}
示例12: Replay
public override void Replay(NavigationService navigationService, NavigationMode mode)
{
ContentControl navigator = (ContentControl)navigationService.INavigatorHost;
// Find a reference to the DocumentViewer hosted in the NavigationWindow
// On initial history navigation in the browser, the window's layout may not have been
// done yet. ApplyTemplate() causes the viewer to be created.
navigator.ApplyTemplate();
DocumentApplicationDocumentViewer docViewer = navigator.Template.FindName(
"PUIDocumentApplicationDocumentViewer", navigator)
as DocumentApplicationDocumentViewer;
Debug.Assert(docViewer != null, "PUIDocumentApplicationDocumentViewer not found.");
if (docViewer != null)
{
// Set the new state on the DocumentViewer
if (_state is DocumentApplicationState)
{
docViewer.StoredDocumentApplicationState = (DocumentApplicationState)_state;
}
// Check that a Document exists.
if (navigationService.Content != null)
{
IDocumentPaginatorSource document = navigationService.Content as IDocumentPaginatorSource;
// If the document has already been paginated (could happen in the
// case of a fragment navigation), then set the DocumentViewer to the
// new state that was set.
if ((document != null) && (document.DocumentPaginator.IsPageCountValid))
{
docViewer.SetUIToStoredState();
}
}
}
}
示例13: OnNavigatedTo
public override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
{
if (navigationParameter != null)
{
Items = navigationParameter as IEnumerable<ProductInformation>;
}
}
示例14: OnNavigatedToAsync
public async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
(nav as MergedNavigationService).Clear();
JObject param = (JObject)Portable.Helpers.StateHelper.SessionState["LaunchData"];
if (param["url"] == null)
{
isUrlLaunch = false;
}
else
{
isUrlLaunch = true;
string url = (string)param["url"];
var query = Uri.UnescapeDataString(new Uri(url).Query);
query = query.StartsWith("?") ? query.Substring(1) : query;
string[] frags = query.Split('&');
foreach (var frag in frags)
{
string[] splits = frag.Split('=');
state.Add(splits[0], splits[1]);
}
(SimpleIoc.Default.GetInstance<IViewModelLocator>().BrowserViewModel as BrowserPageViewModel).State = state;
}
if ((bool)param["isNewLaunch"])
await base.ShakeHandsAndNavigate();
else
await Navigate();
}
示例15: OnNavigatedToAsync
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
Reading = SessionState["reading"] as ePub;
ContentWebView = (NavigationService.Content as ReadingPage).FindName("ContentWebView") as WebView;
ContentWebView.NavigateToString(await LoadHtmlFromManifestItem(Reading.Manifest.First()));
await Task.CompletedTask;
}