当前位置: 首页>>代码示例>>C#>>正文


C# NavigationService.Navigate方法代码示例

本文整理汇总了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;
 }
开发者ID:JulianMH,项目名称:DoIt,代码行数:7,代码来源:ApplicationBarHelpers.cs

示例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);
		}
开发者ID:oclockvn,项目名称:wpf.navigatepage,代码行数:30,代码来源:NavigationAnimator.cs

示例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);
        }
开发者ID:chahla,项目名称:wpf-medical,代码行数:9,代码来源:PatientPictureViewModel.cs

示例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));
     }
 }
开发者ID:kstuDss,项目名称:DecisionSupportSystem,代码行数:9,代码来源:PageCombinations.xaml.cs

示例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));
            }
        }
开发者ID:kstuDss,项目名称:DecisionSupportSystem,代码行数:16,代码来源:MainPage.xaml.cs

示例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)";
        }
开发者ID:chahla,项目名称:wpf-medical,代码行数:75,代码来源:PatientAddViewModel.cs

示例7: ShowView

 public void ShowView(NavigationService navigation)
 {
     navigation.Navigate(new Uri("/Views/SettingsPage.xaml", UriKind.Relative));
 }
开发者ID:crawford,项目名称:WpGatekeeper,代码行数:4,代码来源:SettingsViewModel.cs

示例8: TryGoBack

 public static void TryGoBack(NavigationService NavigationService, Uri DefaultLocation)
 {
     if (NavigationService.CanGoBack)
         NavigationService.GoBack();
     else
         NavigationService.Navigate(DefaultLocation);
 }
开发者ID:ireynolds,项目名称:Document-Store,代码行数:7,代码来源:Utils.cs

示例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");
     }
 }
开发者ID:WhistMo,项目名称:OneTap_MITBBS,代码行数:17,代码来源:NotificationCenter.cs

示例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();
        }
开发者ID:chahla,项目名称:wpf-medical,代码行数:89,代码来源:LoginViewModel.cs

示例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);
     //}
 }
开发者ID:koush,项目名称:GoogleVoice,代码行数:15,代码来源:App.xaml.cs

示例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());
 }
开发者ID:shonwang,项目名称:sgs,代码行数:6,代码来源:Login.xaml.cs

示例13: BtnPrev_Click

 private void BtnPrev_Click(object sender, RoutedEventArgs e)
 {
     _navigation = NavigationService.GetNavigationService(this);
     _navigation.Navigate(new PageCombinations(_baseLayer, _preferences, _model));
 }
开发者ID:kstuDss,项目名称:DecisionSupportSystem,代码行数:5,代码来源:PageSolution.xaml.cs

示例14: BtnPrev_Click

 private void BtnPrev_Click(object sender, RoutedEventArgs e)
 {
     navigation = NavigationService.GetNavigationService(this);
     navigation.Navigate(new PageCombinations(_baseLayer));
 }
开发者ID:kstuDss,项目名称:DecisionSupportSystem,代码行数:5,代码来源:PageSolve.xaml.cs

示例15: Open

 public void Open(NavigationService NavigationService)
 {
     Utils.SetArguments(this, IsTemp);
     NavigationService.Navigate(App.DocumentEditor);
 }
开发者ID:hmehart,项目名称:Notepad,代码行数:5,代码来源:Document.cs


注:本文中的System.Windows.Navigation.NavigationService.Navigate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。