本文整理汇总了C#中PhoneApplicationFrame.Navigate方法的典型用法代码示例。如果您正苦于以下问题:C# PhoneApplicationFrame.Navigate方法的具体用法?C# PhoneApplicationFrame.Navigate怎么用?C# PhoneApplicationFrame.Navigate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhoneApplicationFrame
的用法示例。
在下文中一共展示了PhoneApplicationFrame.Navigate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenPickerPage
public void OpenPickerPage()
{
if (null == PickerPageUri)
{
throw new ArgumentException("PickerPageUri property must not be null.");
}
if (null == _frame)
{
_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (null != _frame)
{
_frameContentWhenOpened = _frame.Content;
// Save and clear host page transitions for the upcoming "popup" navigation
UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
if (null != frameContentWhenOpenedAsUIElement)
{
_savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
_savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
}
_frame.Navigated += OnFrameNavigated;
_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;
_frame.Navigate(PickerPageUri);
}
}
}
示例2: OpenPickerPage
private void OpenPickerPage()
{
frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (frame != null) {
frame.Navigated += FrameNavigated;
frame.Navigate(new Uri("/Flashcards;component/Views/ListPickerPage.xaml", UriKind.Relative));
}
}
示例3: scan
public void scan(string options)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
currentRootVisual = Application.Current.RootVisual as PhoneApplicationFrame;
currentRootVisual.Navigated += OnFrameNavigated;
currentRootVisual.Navigate(new Uri("/Plugins/com.phonegap.plugins.barcodescanner/Scan.xaml", UriKind.Relative));
});
}
示例4: scan
/// <summary>
/// Public method to scan
/// </summary>
public void scan(string options)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
if (null == _frame)
{
// Hook up to necessary events and navigate
_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (null != _frame)
{
_frameContentWhenOpened = _frame.Content;
_frame.Navigated += OnFrameNavigated;
_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;
_frame.Navigate(new System.Uri("/Plugins/com.phonegap.plugins.barcodescanner/Scanner.xaml?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative));
}
}
});
}
示例5: OpenPickerPage
private void OpenPickerPage(DateTimePickerType type)
{
var page = type == DateTimePickerType.Date
? "/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/DatePickerPage.xaml?dummy="
: "/Coding4Fun.Toolkit.Controls;component/ValuePicker/TimeSpanPicker/TimespanPickerPage.xaml?dummy=";
page += Guid.NewGuid();
var pickerPageUri = new Uri(page, UriKind.Relative);
if (_frame != null) return;
_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (_frame == null) return;
_frameContentWhenOpened = _frame.Content;
var uiElement = _frameContentWhenOpened as UIElement;
if (null != uiElement)
{
_savedNavigationInTransition = TransitionService.GetNavigationInTransition(uiElement);
TransitionService.SetNavigationInTransition(uiElement, null);
_savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(uiElement);
TransitionService.SetNavigationOutTransition(uiElement, null);
}
if (type == DateTimePickerType.Date)
{
_frame.Navigated += OnDateFrameNavigated;
}
else
{
_frame.Navigated += OnTimeFrameNavigated;
}
_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;
_frame.Navigate(pickerPageUri);
}
示例6: OpenPickerPage
private void OpenPickerPage()
{
if (null == PickerPageUri)
{
throw new ArgumentException("PickerPageUri");
}
if (null == _frame)
{
// Hook up to necessary events and navigate
_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (null != _frame)
{
_frameContentWhenOpened = _frame.Content;
// Save and clear host page transitions for the upcoming "popup" navigation
UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
if (null != frameContentWhenOpenedAsUIElement)
{
_savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
_savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
}
_frame.Navigated += new NavigatedEventHandler(HandleFrameNavigated);
_frame.NavigationStopped += new NavigationStoppedEventHandler(HandleFrameNavigationStoppedOrFailed);
_frame.NavigationFailed += new NavigationFailedEventHandler(HandleFrameNavigationStoppedOrFailed);
_hasPickerPageOpen = true;
_frame.Navigate(PickerPageUri);
}
}
}
示例7: OpenPickerPage
/// <summary>
/// Opens the page to select the date or time value
/// </summary>
private void OpenPickerPage(DateTimePickerType type)
{
string pickerPageName = type == DateTimePickerType.Date ? "DatePickerPage.xaml" : "TimePickerPage.xaml";
Uri pickerPageUri = new System.Uri("/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/" +
pickerPageName + "?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative);
if (null == _frame)
{
// Hook up to necessary events and navigate
_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (null != _frame)
{
_frameContentWhenOpened = _frame.Content;
// Save and clear host page transitions for the upcoming "popup" navigation
UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
if (null != frameContentWhenOpenedAsUIElement)
{
_savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
_savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
}
_frame.Navigated += OnFrameNavigated;
_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;
_frame.Navigate(pickerPageUri);
}
}
}
示例8: InitializePhoneApplication
// Fügen Sie dieser Methode keinen zusätzlichen Code hinzu.
private void InitializePhoneApplication()
{
if (phoneApplicationInitialized)
return;
// Erstellen Sie den Frame, aber legen Sie ihn noch nicht als RootVisual-Objekt fest; auf diese Weise
// bleibt der Begrüßungsbildschirm aktiv, bis die Anwendung zum Rendern bereit ist.
RootFrame = new PhoneApplicationFrame();
RootFrame.Navigated += CompleteInitializePhoneApplication;
// Handhabung von Navigationsfehlern
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
// Stellen Sie sicher, dass keine erneute Initialisierung erfolgt.
phoneApplicationInitialized = true;
RootFrame.Navigate(new Uri("MainPage.xaml", UriKind.Relative));
}
示例9: OpenPickerPage
public static void OpenPickerPage(DateTime selectedValue, DateTime? lowerBound, DateTime? upperBound, Action<DateTime> finished)
{
if (_frame != null) throw new InvalidOperationException("Picker page is already open.");
DateTimePickerHelper.selectedValue = selectedValue.Date;
DateTimePickerHelper.finished = finished;
DateTimePickerHelper.lowerBound = lowerBound;
DateTimePickerHelper.upperBound = upperBound;
// Hook up to necessary events and navigate
_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (null == _frame) throw new InvalidOperationException("Cannot find PhoneApplicationFrame");
_frameContentWhenOpened = _frame.Content;
// Save and clear host page transitions for the upcoming "popup" navigation
UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
if (null != frameContentWhenOpenedAsUIElement)
{
_savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
_savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
}
_frame.Navigated += OnFrameNavigated;
_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;
_frame.Navigate(DefaultPickerPageUri);
}
示例10: OpenPage
private void OpenPage(Uri uri)
{
if (_frame == null) {
_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (_frame != null) {
_frameContentWhenOpened = _frame.Content;
_frame.Navigated += OnFrameNavigated;
_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;
_frame.Navigate(uri);
}
}
}
示例11: RootVisualNavigate
private static void RootVisualNavigate(PhoneApplicationFrame frame, string uri)
{
frame.Navigate(new Uri(uri, UriKind.RelativeOrAbsolute));
}
示例12: InitializePhoneApplication
// Do not add any additional code to this method
private void InitializePhoneApplication()
{
if (phoneApplicationInitialized)
return;
// Create the frame but don't set it as RootVisual yet; this allows the splash
// screen to remain active until the application is ready to render.
RootFrame = new PhoneApplicationFrame();
RootFrame.Navigated += CompleteInitializePhoneApplication;
// Handle navigation failures
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
// Handle reset requests for clearing the backstack
RootFrame.Navigated += CheckForResetNavigation;
// Handle contract activation such as a file open or save picker
PhoneApplicationService.Current.ContractActivated += Application_ContractActivated;
// Assign the custom URI mapper class to the application frame.
RootFrame.UriMapper = new CustomMapping.CustomUriMapper();
// Ensure we don't initialize again
phoneApplicationInitialized = true;
PhoneApplicationService.Current.ContractActivated += Application_ContractActivated;
var appBar = App.Current.Resources["GlobalAppBar"] as ApplicationBar;
((ApplicationBarMenuItem)appBar.MenuItems[0]).Text = AppResources.AppBarHome;
((ApplicationBarMenuItem)appBar.MenuItems[1]).Text = AppResources.AppBarUpload;
((ApplicationBarMenuItem)appBar.MenuItems[2]).Text = AppResources.AppBarSettings;
((ApplicationBarMenuItem)appBar.MenuItems[3]).Text = AppResources.AppBarAbout;
if (IsolatedStorageSettings.ApplicationSettings.Contains("tokensaved"))
{
if (GlobalVariables.IsolatedStorageUserInformations.Contains("tokensaved") && GlobalVariables.IsolatedStorageUserInformations.Contains("urlsaved"))
{
string t = GlobalVariables.IsolatedStorageUserInformations["tokensaved"] as string;
string u = GlobalVariables.IsolatedStorageUserInformations["urlsaved"] as string;
RootFrame.Navigate(new Uri("/Pages/ListLibraryPage.xaml?token=" + t + "&url=" + u, UriKind.Relative));
}
}
else
{
RootFrame.Navigate(new Uri("/Login.xaml", UriKind.RelativeOrAbsolute));
}
}
示例13: InitializePhoneApplication
// Do not add any additional code to this method
private void InitializePhoneApplication()
{
if (phoneApplicationInitialized)
return;
// Create the frame but don't set it as RootVisual yet; this allows the splash
// screen to remain active until the application is ready to render.
RootFrame = new PhoneApplicationFrame();
RootFrame.Navigated += CompleteInitializePhoneApplication;
// Handle navigation failures
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
// Handle reset requests for clearing the backstack
RootFrame.Navigated += CheckForResetNavigation;
// Ensure we don't initialize again
phoneApplicationInitialized = true;
if (settings.Contains("Token") && settings.Contains("TokenStatus"))
{
var token = settings["Token"];
var tokenStatus = (TokenStatus)settings["TokenStatus"];
if (token != null && tokenStatus == TokenStatus.VALID)
{
RootFrame.Navigate(new Uri("/MainPage.xaml", UriKind.RelativeOrAbsolute));
}
else
{
var text = "Please accept application request from \"Nordic-T WP8\"";
var caption = "Token not accepted";
RootFrame.Navigate(new Uri("/Login.xaml?text=" + text + "+caption=" + caption, UriKind.RelativeOrAbsolute));
}
}
else
{
RootFrame.Navigate(new Uri("/Login.xaml", UriKind.RelativeOrAbsolute));
}
}
示例14: InitializePhoneApplication
// Do not add any additional code to this method
private void InitializePhoneApplication()
{
if (phoneApplicationInitialized)
return;
// Create the frame but don't set it as RootVisual yet; this allows the splash
// screen to remain active until the application is ready to render.
RootFrame = new PhoneApplicationFrame();
RootFrame.Navigated += CompleteInitializePhoneApplication;
// Handle navigation failures
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
// Handle reset requests for clearing the backstack
RootFrame.Navigated += CheckForResetNavigation;
// Handle contract activation such as a file open or save picker
PhoneApplicationService.Current.ContractActivated += Application_ContractActivated;
// Ensure we don't initialize again
phoneApplicationInitialized = true;
CopyDatabase();
var builder = new ContainerBuilder();
builder.RegisterModule(new OwModule());
IContainer container = builder.Build();
var locator = new AutofacServiceLocator(container);
ServiceLocator.SetLocatorProvider(() => locator);
var session = ServiceLocator.Current
.GetInstance<Session>();
session.LoadData();
var chatManager = ServiceLocator.Current
.GetInstance<ChatManager>();
chatManager.Initialize();
if (session.User != null)
{
RootFrame.Navigate(new Uri("/View/MainPage.xaml", UriKind.RelativeOrAbsolute));
}
else
{
RootFrame.Navigate(new Uri("/View/LoginPage.xaml", UriKind.RelativeOrAbsolute));
}
}
示例15: OpenPickerPage
private static void OpenPickerPage()
{
if (null == m_frame)
{
m_frame = Application.Current.RootVisual as PhoneApplicationFrame;
if (null != m_frame)
{
m_frameContentWhenOpened = m_frame.Content;
m_frame.Navigated += OnFrameNavigated;
m_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
m_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;
m_frame.Navigate(new Uri("/RhoRubyLib;component/views/RhoDateTimeDlg.xaml", UriKind.Relative));
RHODESAPP().m_transition = true;
}
}
}