本文整理汇总了C#中System.Windows.Navigation.NavigationService.Navigate方法的典型用法代码示例。如果您正苦于以下问题:C# NavigationService.Navigate方法的具体用法?C# NavigationService.Navigate怎么用?C# NavigationService.Navigate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Navigation.NavigationService
的用法示例。
在下文中一共展示了NavigationService.Navigate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateButton
internal static ApplicationBarIconButton CreateButton(string text, string iconPath, NavigationService navigationService, string navigateTo)
{
ApplicationBarIconButton button = new ApplicationBarIconButton(new Uri(iconPath, UriKind.Relative));
button.Text = text;
button.Click += (sender, e) => { navigationService.Navigate(new Uri(navigateTo, UriKind.Relative)); };
return button;
}
示例2: Navigate
public void Navigate(Frame frame, FrameworkElement nextElement)
{
navigationService = frame.NavigationService;
if (navigationService == null) { return; }
srcElement = navigationService.Content as FrameworkElement;
targetElement = nextElement;
if (srcElement != null)
{
navigationService.Navigating += NavigationAnimator_Navigating;
}
if (transition == null)
{
var mask1 = new Rectangle()
{
Fill = new SolidColorBrush(Color.FromArgb(77, 8, 17, 48))
};
var mask2 = new Rectangle()
{
Fill = new SolidColorBrush(Color.FromArgb(77, 8, 17, 48))
};
transition = new ExampleTransition(mask1, mask2);
}
navigationService.Navigate(nextElement);
}
示例3: NavigateToGraph
private void NavigateToGraph()
{
View.PatientGraphView window = new View.PatientGraphView();
ViewModel.PatientGraphViewModel vm = new PatientGraphViewModel(window);
window.DataContext = vm;
_ns = NavigationService.GetNavigationService(_linkedView);
_ns.Navigate(window);
}
示例4: NextPage_Executed
private void NextPage_Executed(object sender, ExecutedRoutedEventArgs e)
{
if (ErrorCount.EntityErrorCount == 0)
{
LocalTaskLayer.taskParams.InitTask();
navigation = NavigationService.GetNavigationService(this);
navigation.Navigate(new PageSolve(_baseLayer));
}
}
示例5: downloadSolvedBtn_Click
private void downloadSolvedBtn_Click(object sender, RoutedEventArgs e)
{
var element = GetTaskType();
if (element != null)
{
var taskEx = new TaskViewForMainWindows
{
Name = element.ChildNodes[0].InnerText,
TaskUniq = element.ChildNodes[3].InnerText,
Window = element.ChildNodes[4].InnerText
};
navigation = NavigationService.GetNavigationService(this);
navigation.Navigate(new SolvedTasksPage(taskEx));
}
}
示例6: CreatePatient
private void CreatePatient()
{
BackgroundWorker worker = new BackgroundWorker();
ServicePatient.Patient newPatient = new ServicePatient.Patient();
newPatient.Name = _name;
newPatient.Firstname = _firstname;
int d = 0;
int m = 0;
int y = 0;
if (int.TryParse(_birthday, out d) && int.TryParse(_birthmonth, out m) && int.TryParse(_birthyear, out y))
{
newPatient.Birthday = new DateTime(y, m, d);
worker.DoWork += new DoWorkEventHandler((object s, DoWorkEventArgs e) =>
{
ServicePatient.ServicePatientClient servicePatient = new ServicePatient.ServicePatientClient();
Debug.WriteLine("DEBUT");
_iscreatingpatient = true;
BackgroundWorker bg = s as BackgroundWorker;
e.Result = servicePatient.AddPatient(newPatient);
});
// TODO penser a mettre un comportement en fonction des differents cas notamment en cas de fail
worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler((object s, RunWorkerCompletedEventArgs e) =>
{
Debug.WriteLine("FIN");
_iscreatingpatient = false;
WaitingMessage = "";
if (e.Cancelled)
{
Debug.WriteLine("CANCELLED");
WaitingMessage = "L'opération a été annulée.";
}
if (e.Error != null)
{
Debug.WriteLine("ERROR");
WaitingMessage = "Erreur lors de la création : " + e.Error.Message;
}
bool? res = e.Result as bool?;
if (res == null)
{
Debug.WriteLine("ERREUR COTE SERVEUR");
WaitingMessage = "Erreur côté serveur lors de la création. Veuillez recommencer";
}
if (res == true)
{
WaitingMessage = "Création réussie";
View.PatientBrowserView window = new View.PatientBrowserView();
ViewModel.PatientBrowserViewModel vm = new PatientBrowserViewModel(window);
window.DataContext = vm;
_ns = NavigationService.GetNavigationService(_linkedView);
_ns.Navigate(window);
WaitingMessage = "";
}
else
{
Debug.WriteLine("ECHEC DE LA CREATION");
WaitingMessage = "La création a échoué. Veuillez recommencer.";
}
});
worker.RunWorkerAsync();
WaitingMessage = "Création du patient";
}
WaitingMessage = "Veuillez indiquer des dates valides (ex : 26 07 1989)";
}
示例7: ShowView
public void ShowView(NavigationService navigation)
{
navigation.Navigate(new Uri("/Views/SettingsPage.xaml", UriKind.Relative));
}
示例8: TryGoBack
public static void TryGoBack(NavigationService NavigationService, Uri DefaultLocation)
{
if (NavigationService.CanGoBack)
NavigationService.GoBack();
else
NavigationService.Navigate(DefaultLocation);
}
示例9: OpenNotification
public void OpenNotification(NavigationService nav)
{
if (_hasNewMail)
{
String pageUrl = String.Format("/Pages/MailboxPage.xaml?Url={0}&MailboxName={1}",
Uri.EscapeDataString(App.Settings.BuildUrl(MitbbsMailbox.InboxUrl)),
Uri.EscapeDataString("收件箱"));
App.Track("Navigation", "EntryPoint", "NottificationCenterNewMail");
nav.Navigate(new Uri(pageUrl, UriKind.Relative));
HasNewMail = false;
}
else if (_hasNewUpdate)
{
nav.Navigate(new Uri("/Pages/HistoryPage.xaml", UriKind.Relative));
App.Track("Navigation", "EntryPoint", "NottificationCenterNewUpdate");
}
}
示例10: ClickConnect
/// <summary>
/// le clic de connection au compte
/// </summary>
private void ClickConnect()
{
/// Le bgw servant a verifier si le compte existe
BackgroundWorker worker = new BackgroundWorker();
/// le bgw servant a determiner le role
BackgroundWorker workerFetchRole = new BackgroundWorker();
ServiceUser.ServiceUserClient userService = new ServiceUser.ServiceUserClient();
worker.DoWork += new DoWorkEventHandler((object s, DoWorkEventArgs e) =>
{
_ischecking = true;
e.Result = userService.Connect(_login, _password);
});
worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler((object s, RunWorkerCompletedEventArgs e) =>
{
EndWaitingSequence();
_ischecking = false;
// TODO voir le CreateUserViewModel pour l'implementation erreur
if (e.Cancelled)
{
WaitingMessage = "L'opération a été annulée.";
}
if (e.Error != null)
{
WaitingMessage = "Erreur lors de l'authentification : " + e.Error.Message;
}
bool? res = e.Result as bool?;
if (res == null)
{
WaitingMessage = "Erreur côté serveur lors de l'authentification. Veuillez recommencer";
}
if (res == true)
{
/// Le webservice nous indique que le compte est valide mais on ne connait
/// pas encore le role de l'utilisateur On doit donc faire appel a un
/// autre webservice
workerFetchRole.RunWorkerAsync();
View.HomeView window = new View.HomeView();
ViewModel.HomeViewModel vm = new HomeViewModel(window);
window.DataContext = vm;
_ns = NavigationService.GetNavigationService(_linkedView);
_ns.Navigate(window);
}
else {
Debug.WriteLine("NON ENREGISTRE");
WaitingMessage = "Erreur de login ou mot de passe.";
}
});
workerFetchRole.DoWork += new DoWorkEventHandler((object s, DoWorkEventArgs e) =>
{
e.Result = userService.GetRole(_login);
});
workerFetchRole.RunWorkerCompleted += new RunWorkerCompletedEventHandler((object s, RunWorkerCompletedEventArgs e) =>
{
if (e.Cancelled)
{
WaitingMessage = "L'opération a été annulée.";
}
if (e.Error != null)
{
WaitingMessage = "Erreur lors de l'authentification : " + e.Error.Message;
}
string res = e.Result as string;
if (res == null)
{
WaitingMessage = "Erreur côté serveur lors de l'authentification. Veuillez recommencer";
}
if ((res == "Chirurgien") || (res == "Medecin") || (res == "Radiologue")) {
NavigationMessenger.GetInstance().IsRWAccount = true;
}
else {
NavigationMessenger.GetInstance().IsRWAccount = false;
}
});
worker.RunWorkerAsync();
BeginWaitingSequence();
}
示例11: Call
public static void Call(string name, string number, NavigationService nav)
{
nav.Navigate(new Uri(string.Format("/CallPage.xaml?name={0}&phone={1}", name, number), UriKind.Relative));
//if (Settings.Instance.ShouldUsePINDial)
//{
// var t = new Microsoft.Phone.Tasks.PhoneCallTask();
// t.DisplayName = name;
// t.PhoneNumber = mVoice.GetDirectDialNumber(number);
// t.Show();
//}
//else
//{
// mVoice.Call(number);
//}
}
示例12: lobby_OnNavigateBack
private static void lobby_OnNavigateBack(object sender, NavigationService service)
{
LobbyView lobby = sender as LobbyView;
if (lobby != null) lobby.OnNavigateBack -= lobby_OnNavigateBack;
service.Navigate(new Login());
}
示例13: BtnPrev_Click
private void BtnPrev_Click(object sender, RoutedEventArgs e)
{
_navigation = NavigationService.GetNavigationService(this);
_navigation.Navigate(new PageCombinations(_baseLayer, _preferences, _model));
}
示例14: BtnPrev_Click
private void BtnPrev_Click(object sender, RoutedEventArgs e)
{
navigation = NavigationService.GetNavigationService(this);
navigation.Navigate(new PageCombinations(_baseLayer));
}
示例15: Open
public void Open(NavigationService NavigationService)
{
Utils.SetArguments(this, IsTemp);
NavigationService.Navigate(App.DocumentEditor);
}