本文整理汇总了C#中NavigationMode类的典型用法代码示例。如果您正苦于以下问题:C# NavigationMode类的具体用法?C# NavigationMode怎么用?C# NavigationMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationMode类属于命名空间,在下文中一共展示了NavigationMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:GFlisch,项目名称:Template10,代码行数:30,代码来源:NavigationLogic.cs
示例2: NavigatingCancelEventArgs
public NavigatingCancelEventArgs(IViewMappingItem mapping, NavigationMode navigationMode, string parameter)
{
_mapping = mapping;
_navigationMode = navigationMode;
_parameter = parameter;
_isCancelable = true;
}
开发者ID:sami1971,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:NavigatingCancelEventArgs.cs
示例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;
}
开发者ID:VOChris,项目名称:VOStudios,代码行数:7,代码来源:MovementBasedLogicTile.cs
示例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;
}
开发者ID:Codername,项目名称:UWP-App-Samples,代码行数:25,代码来源:MainPageViewModel.cs
示例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();
}
}
}
开发者ID:thewindev,项目名称:Toastmaster-Tools,代码行数:25,代码来源:LoginViewModel.cs
示例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);
}
}
}
}
开发者ID:JamesCarswell,项目名称:Template10,代码行数:33,代码来源:NavigationService.cs
示例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();
}
}
}
开发者ID:stevenh77,项目名称:ItineraryHunter-Win8,代码行数:35,代码来源:PaymentMethodUserControlViewModel.cs
示例8: NavigatingCancelEventArgs
public NavigatingCancelEventArgs(Type pageType, NavigationMode mode, bool isCancelable, bool isNavigationInitiator)
{
this.SourcePageType = pageType;
this.NavigationMode = mode;
this.IsCancelable = isCancelable;
this.IsNavigationInitiator = isNavigationInitiator;
}
开发者ID:evnik,项目名称:UIFramework,代码行数:7,代码来源:NavigatingCancelEventArgs.cs
示例9: OnNavigatedTo
public override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
{
if (navigationParameter != null)
{
SelectedNews = navigationParameter as News;
}
}
开发者ID:lab4utest,项目名称:Prism-UniversalSample,代码行数:7,代码来源:DetailPageViewModel.cs
示例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();
}
开发者ID:elefantstudio-se,项目名称:vPlan-Exempel,代码行数:7,代码来源:MessagesPageViewModel.cs
示例11: GetDeactivateEvent
private DeactivateEvent GetDeactivateEvent(NavigationMode mode)
{
if (mode == NavigationMode.Back) return DeactivateEvent.Back;
if (mode == NavigationMode.Forward) return DeactivateEvent.Forward;
return DeactivateEvent.Default;
}
开发者ID:woellij,项目名称:mvvmcross-controllers,代码行数:7,代码来源:StorePageBase.cs
示例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();
}
}
}
}
开发者ID:JianwenSun,项目名称:cc,代码行数:34,代码来源:DocumentApplicationJournalEntry.cs
示例13: OnNavigatedTo
public override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
{
if (navigationParameter != null)
{
Items = navigationParameter as IEnumerable<ProductInformation>;
}
}
开发者ID:ivpadim,项目名称:AzurePocketGuide,代码行数:7,代码来源:ProductInformationPageViewModel.cs
示例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();
}
开发者ID:akshay2000,项目名称:MonocleGiraffe,代码行数:29,代码来源:SplashPageViewModel.cs
示例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;
}
开发者ID:RareNCool,项目名称:EPubReader,代码行数:7,代码来源:ReadingPageViewModel.cs
示例16: OnNavigatedTo
public override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewModelState)
{
// 画面遷移してきたときに呼ばれる
base.OnNavigatedTo(navigationParameter, navigationMode, viewModelState);
Photo = navigationParameter as Photo.PhotoItem;
}
开发者ID:TK-R,项目名称:wpproconapp,代码行数:7,代码来源:PhotoPageViewModel.cs
示例17: OnNavigatedTo
// </snippet412>
public async override void OnNavigatedTo(object navigationParameter, NavigationMode navigationMode, Dictionary<string, object> viewState)
{
ReadOnlyCollection<Category> rootCategories = null;
var getCategoriesCallFailed = false;
try
{
// <snippet511>
rootCategories = await _productCatalogRepository.GetCategoriesAsync(50);
// </snippet511>
}
catch (HttpRequestException)
{
getCategoriesCallFailed = true;
}
if (getCategoriesCallFailed)
{
await _alertMessageService.ShowAsync(_resourceLoader.GetString("ErrorServiceUnreachable"), _resourceLoader.GetString("Error"));
return;
}
var rootCategoryViewModels = new List<CategoryViewModel>();
foreach (var rootCategory in rootCategories)
{
rootCategoryViewModels.Add(new CategoryViewModel(rootCategory, _navigationService));
}
RootCategories = new ReadOnlyCollection<CategoryViewModel>(rootCategoryViewModels);
_searchPaneService.ShowOnKeyboardInput(true);
}
开发者ID:stevenh77,项目名称:ItineraryHunter-Win8,代码行数:31,代码来源:HubPageViewModel.cs
示例18: AlternativeNavigationEventArgs
/// <summary>
/// Initializes a new instance of the <see cref="AlternativeNavigationEventArgs" /> class.
/// </summary>
/// <param name="content">The content.</param>
/// <param name="navigationMode">The navigation mode.</param>
/// <param name="parameter">The parameter.</param>
/// <param name="sourcePageType">Type of the source page.</param>
public AlternativeNavigationEventArgs(object content, NavigationMode navigationMode, object parameter, Type sourcePageType)
{
this.Content = content;
this.NavigationMode = navigationMode;
this.Parameter = parameter;
this.SourcePageType = sourcePageType;
}
开发者ID:cstehreem,项目名称:WinRTXamlToolkit,代码行数:14,代码来源:AlternativeNavigationEventArgs.cs
示例19: OnNavigatedToAsync
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
var sessionId = _appSettings.Get<string>(StorageKey.SessionId);
IsLoggedIn = string.IsNullOrWhiteSpace(sessionId) == false;
if (IsLoggedIn)
UserDisplayName = _appSettings.Get<string>(StorageKey.UserDisplayName);
}
开发者ID:thewindev,项目名称:Toastmaster-Tools,代码行数:7,代码来源:HomeViewModel.cs
示例20: NavigateTo
void NavigateTo(NavigationMode mode, string parameter)
{
LastNavigationParameter = parameter;
LastNavigationType = _frame.Content.GetType().FullName;
if (mode == NavigationMode.New)
{
// TODO: clear existing state
}
var page = _frame.Content as FrameworkElement;
if (page != null)
{
var dataContext = page.DataContext;
if (dataContext != null)
{
// navigationService will not depend on Mvvm namespace
var method = dataContext.GetType()
.GetRuntimeMethod(OnNavigatedTo, new[] {
typeof(string),
typeof(NavigationMode),
typeof(Dictionary<string, object>)
});
if (method != null)
{
// TODO: get existing state
method.Invoke(dataContext, new object[] { parameter, mode, null });
}
}
}
}
开发者ID:MuffPotter,项目名称:201505-MVA,代码行数:31,代码来源:NavigationService.cs
注:本文中的NavigationMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论