本文整理汇总了C#中NavigationEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# NavigationEventArgs类的具体用法?C# NavigationEventArgs怎么用?C# NavigationEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationEventArgs类属于命名空间,在下文中一共展示了NavigationEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
// Load data for the ViewModel Items
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (!App.ViewModel.IsDataLoaded)
{
App.ViewModel.LoadData();
}
}
示例2: NavigatedEventArgs
public NavigatedEventArgs(NavigationEventArgs e, Page page)
{
Page = page;
PageType = e.SourcePageType;
Parameter = e.Parameter;
NavigationMode = e.NavigationMode;
}
示例3: NavigationEventArgsAdapter
internal NavigationEventArgsAdapter( NavigationEventArgs source )
{
Contract.Requires( source != null );
this.source = source;
Uri = source.Uri;
IsSuccess = true;
}
示例4: DialogWebBrowserOnLoadCompleted
async private void DialogWebBrowserOnLoadCompleted(object sender, NavigationEventArgs args)
#endif
{
if (args.Uri.ToString().StartsWith("https://www.facebook.com/connect/login_success.html"))
{
if (ParentControlPopup != null)
{
ParentControlPopup.IsOpen = false;
}
if (!args.Uri.Fragment.Contains("access_token"))
{
// this callback is in return for the dialog, so just cancel it.
if (OnDialogFinished != null)
{
OnDialogFinished(WebDialogResult.WebDialogResultDialogCompleted);
}
return;
}
try
{
var client = new FacebookClient();
var authResult = client.ParseOAuthCallbackUrl(args.Uri);
client = new FacebookClient(authResult.AccessToken);
var parameters = new Dictionary<string, object>();
parameters["fields"] = "id";
var result = await client.GetTaskAsync("me", parameters);
var dict = (IDictionary<string, object>)result;
Session.ActiveSession.CurrentAccessTokenData = new AccessTokenData
{
AccessToken = authResult.AccessToken,
Expires = authResult.Expires,
FacebookId = (string)dict["id"],
AppId = Session.AppId
};
if (Session.OnFacebookAuthenticationFinished != null)
{
Session.OnFacebookAuthenticationFinished(Session.ActiveSession.CurrentAccessTokenData);
}
if (Session.OnSessionStateChanged != null)
{
Session.OnSessionStateChanged(LoginStatus.LoggedIn);
}
}
catch (Facebook.FacebookOAuthException exc)
{
// TODO: (sanjeevd) catch appropriately
}
}
}
示例5: InternalOnNavigatedFrom
protected internal override void InternalOnNavigatedFrom(NavigationEventArgs e)
{
base.InternalOnNavigatedFrom(e);
var frameState = SuspensionManager.SessionStateForFrame(Frame);
var pageState = new Dictionary<String, Object>();
SaveState(pageState);
frameState[pageKey] = pageState;
}
示例6: DumpExistingViewModel
protected virtual void DumpExistingViewModel(NavigationEventArgs e)
{
// Make sure we get a new VM each time we arrive at the page
if (e.NavigationMode != NavigationMode.Back)
{
DataContext = null;
ViewModel = null;
}
}
示例7: FrameNavigated
void FrameNavigated(object sender, NavigationEventArgs e)
{
#if WINDOWS_PHONE
if (e.IsNavigationInitiator)
#endif
{
Dispose();
}
}
示例8: OnNavigatedFrom
/// <summary>
/// Invoked immediately after the Page is unloaded and is no longer the current source of a parent Frame.
/// </summary>
/// <param name="e">Event data that can be examined by overriding code. The event data is representative of the navigation that has unloaded the current Page.</param>
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
base.OnNavigatedFrom(e);
var vm = this.DataContext as BaseViewModel;
if (vm != null)
{
vm.OnLeft();
}
}
示例9: OnNavigatedFrom
/// <summary>
/// Invoked immediately after the page is unloaded and is no longer the current source of a parent frame.
/// </summary>
/// <param name="e">An object that contains the event data.</param>
protected override async void OnNavigatedFrom(NavigationEventArgs e)
{
base.OnNavigatedFrom(e);
var handler = DataContext as IHandleNavigatedFrom;
if (handler != null)
{
await InvokeHandlerOnNavigatedFromAsync(handler, e.ToNavigationServiceNavigationEventArgs());
}
}
示例10: OnNavigatedTo
// Executes when the user navigates to this page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (e.ExtraData == null)
{
// user inadvertently landed to the error page, redirect to the home page
this.GetNavigator().Navigate(new Uri("/Home", UriKind.Relative));
return;
}
ApplicationUnhandledExceptionEventArgs errorArgs = e.ExtraData as ApplicationUnhandledExceptionEventArgs;
errorDetails.Text = errorArgs.ExceptionObject.Message + "\n" + errorArgs.ExceptionObject.StackTrace;
}
示例11: OnFirstNavigation
private void OnFirstNavigation( object sender, NavigationEventArgs e )
{
Contract.Requires( sender != null );
Contract.Requires( e != null );
var frame = (Frame) sender;
frame.Navigated -= OnFirstNavigation;
frame.ContentTransitions = transitions ?? new TransitionCollection() { new NavigationThemeTransition() };
transitions = null;
}
示例12: FacadeNavigatedEventHandler
void FacadeNavigatedEventHandler(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
{
foreach (var handler in _navigatedEventHandlers)
{
var args = new NavigationEventArgs()
{
NavigationMode = e.NavigationMode,
Parameter = (e.Parameter == null) ? string.Empty : e.Parameter.ToString()
};
handler(this, args);
}
}
示例13: OnNavigatedTo
/// <summary>
/// When navigating to this page, DataContext.ImageStream will be set as the source
/// for the Image control in XAML. If ImageStream is null, application will navigate
/// directly back to the main page.
/// </summary>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (_dataContext.ImageStream != null)
{
_bitmap.SetSource(_dataContext.ImageStream);
image.Source = _bitmap;
}
else
{
NavigationService.GoBack();
}
base.OnNavigatedTo(e);
}
示例14: ContentFrame_Navigated
// set the browser's page title using branded format string
private void ContentFrame_Navigated(object sender, NavigationEventArgs e)
{
string title = string.Empty;
object content = e.Content;
if (content == null)
content = ContentFrame.Content;
if (content is Page)
title = ((Page)content).Title;
if (CrossPlatform.IsHtmlPageEnabled())
CrossPlatform.SetDocumentTitle("Intersoft ClientUI Application | " + title);
}
示例15: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs args)
{
if (Manager.CanGoBack)
{
BackButton = Button.TextButton(Manager, Languages.OctoClient.Back);
BackButton.VerticalAlignment = VerticalAlignment.Top;
BackButton.HorizontalAlignment = HorizontalAlignment.Left;
BackButton.LeftMouseClick += (s, e) =>
{
Manager.NavigateBack();
};
BackButton.Margin = new Border(10, 10, 10, 10);
Controls.Add(BackButton);
}
}