• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Navigation.NavigationService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Navigation.NavigationService的典型用法代码示例。如果您正苦于以下问题:C# NavigationService类的具体用法?C# NavigationService怎么用?C# NavigationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NavigationService类属于System.Windows.Navigation命名空间,在下文中一共展示了NavigationService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: StudentManagement

        public StudentManagement(int userId, NavigationService navigationService)
        {
            //User Id and navigation service stored
            _userId = userId;
            _navigationService = navigationService;

            //Page Initialized
            InitializeComponent();

            //Students returned from database
            var studentList = _client.ReturnStudents();

            //Check to ensure students exist
            if (studentList != null)
            {
                //Population of students list
                foreach (var s in studentList)
                {
                    _studentCollectionList.Add(s);
                }
            }
            StudentList.ItemsSource = _studentCollectionList;
            //Default page information set
            Title.Text = "No selection made.";
            Forename.Text = "None";
            Surname.Text = "None";
            Email.Text = "None";
            Course.Text = "None";
            Year.Text = "None";
        }
开发者ID:CfoxQUB,项目名称:DesktopApplication,代码行数:30,代码来源:StudentManagement.xaml.cs


示例2: AddPageToHistory

        public void AddPageToHistory(NavigationService nav)
        {
            int count = GetBackStackCount(nav);

            if (count > PageHistoryStack.Count + 1)
            {
                return;
            }

            if (count < PageHistoryStack.Count)
            {
                PageHistoryStack.RemoveAt(PageHistoryStack.Count - 1);
                LastPageName = null;
            }

            if (count > PageHistoryStack.Count)
            {
                PageHistoryStack.Add(
                    new PageEntry()
                    {
                        PageUrl = nav.CurrentSource.OriginalString
                    }
                    );
                LastPageName = null;
            }
        }
开发者ID:WhistMo,项目名称:OneTap_MITBBS,代码行数:26,代码来源:SessionHistory.cs


示例3: 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


示例4: 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


示例5: ClearBackStack

 public static void ClearBackStack(NavigationService service)
 {
     while (service.BackStack.Any())
     {
         service.RemoveBackEntry();
     }
 }
开发者ID:Giulio-Ladu,项目名称:GameHub,代码行数:7,代码来源:BackstackHelper.cs


示例6: 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


示例7: ReplyCommand

 public ReplyCommand(string threadId, string subject, NavigationService service)
 {
     _threadId = threadId;
     _subject = subject;
     _navigationService = service;
     CanExecuteIt = true;
 }
开发者ID:jbruchanov,项目名称:ZumpaReader-WinPhone,代码行数:7,代码来源:ReplyCommand.cs


示例8: StaffManagement

        public StaffManagement(int userId, NavigationService navigationService)
        {
            //initialization of maintained data
            _userId = userId;
            _navigationService = navigationService;

            //Page rendered
            InitializeComponent();

            //Staff List returned from web service and added to listed display
            var staffList = _client.ReturnStaff();
            if (staffList != null)
            {
                foreach (var s in staffList)
                {
                    _staffCollectionList.Add(s);
                }
            }
            //Binding of  observable collection to page list
            StaffList.ItemsSource = _staffCollectionList;
            //Setting default display items
            Title.Text = "No selection made.";
            Forename.Text = "None";
            Surname.Text = "None";
            Email.Text = "None";
            Course.Text = "None";
        }
开发者ID:CfoxQUB,项目名称:DesktopApplication,代码行数:27,代码来源:StaffManagement.xaml.cs


示例9: CreateNewModule

 //Window initailaized
 public CreateNewModule(int userId, NavigationService navigation)
 {
     //user Id and navigatino service maintained
     _userId = userId;
     _navigation = navigation;
     //Window opened
     InitializeComponent();
 }
开发者ID:CfoxQUB,项目名称:DesktopApplication,代码行数:9,代码来源:CreateNewModule.xaml.cs


示例10: CreateNewCourse

 //Window initailized
 public CreateNewCourse(int userId, NavigationService navigationService)
 {
     //user Id and navigatino service maintained
     _navigation = navigationService;
     _userId = userId;
     //Window initailized
     InitializeComponent();
 }
开发者ID:CfoxQUB,项目名称:DesktopApplication,代码行数:9,代码来源:CreateNewCourse.xaml.cs


示例11: Button1Click

 private void Button1Click(object sender, RoutedEventArgs e)
 {
     if (_beginHost) return;
     e.Handled = true;
     _beginHost = true;
     _ns = NavigationService;
     Program.LClient.BeginHostGame(_game, textBox1.Text);
 }
开发者ID:BastienDurel,项目名称:OCTGN,代码行数:8,代码来源:HostGameSettings.xaml.cs


示例12: FrameNavigationServiceWrapper

 /// <summary>
 /// Initializes a new instance of the <see cref="FrameNavigationServiceWrapper"/> class.
 /// </summary>
 /// <param name="dispatcher">The dispatcher.</param>
 /// <param name="frame">The frame.</param>
 public FrameNavigationServiceWrapper(Dispatcher dispatcher, Frame frame)
 {
     this.dispatcher = dispatcher;
     this.frame = frame;
     navigationService = this.frame.NavigationService;
     navigationService.Navigating += NavigationServiceNavigating;
     navigationService.Navigated += NavigationServiceNavigated;
 }
开发者ID:p69,项目名称:magellan-framework,代码行数:13,代码来源:FrameNavigationServiceWrapper.cs


示例13: PageOptionsOnLoaded

 private void PageOptionsOnLoaded(object sender, RoutedEventArgs e)
 {
     navigation = NavigationService.GetNavigationService(this);
     ComboBox_NumberOfThrowings.SelectedIndex = preferences.NumberOfThrowings - 1;
     TextBox_HeadBonus.Text = preferences.HeadBonus.ToString();
     TextBox_TailCost.Text = preferences.TailCost.ToString();
     TextBox_DoubleHeadBonus.Text = preferences.DoubleHeadBonus.ToString();
 }
开发者ID:kstuDss,项目名称:DecisionSupportSystem,代码行数:8,代码来源:PageOptions.xaml.cs


示例14: CreateNewBuilding

 //window initialized
 public CreateNewBuilding(int userId, NavigationService navigationService)
 {
     //user Id and navigatino service maintained
     _navigation = navigationService;
     _userId = userId;
     //window created
     InitializeComponent();
 }
开发者ID:CfoxQUB,项目名称:DesktopApplication,代码行数:9,代码来源:CreateNewBuilding.xaml.cs


示例15: NavigationTransitionSelector

 /// <summary>
 /// Initializes a new instance of the <see cref="NavigationTransitionSelector"/> class.
 /// </summary>
 /// <param name="navigationService">The navigation service.</param>
 /// <param name="transitionRegistry">The transition registry.</param>
 public NavigationTransitionSelector(NavigationService navigationService, NavigationTransitionRegistry transitionRegistry)
 {
     BackStack = new Stack<NavigationTransition>();
     ForwardStack = new Stack<NavigationTransition>();
     this.transitionRegistry = transitionRegistry;
     this.navigationService = navigationService;
     this.navigationService.Navigating += HandleContentNavigating;
     this.navigationService.Navigated += HandleContentNavigated;
 }
开发者ID:p69,项目名称:magellan-framework,代码行数:14,代码来源:NavigationTransitionSelector.cs


示例16: 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


示例17: 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


示例18: EditStudent

        //Window created
        public EditStudent(int userId, int studentId, NavigationService navigationService)
        {
            //User Id for editing and navigatino service for redirect
            _userId = userId;
            _navigationService = navigationService;
            InitializeComponent();

            //titkles list created
            Titles.Add("Mr");
            Titles.Add("Mrs");
            Titles.Add("Miss");
            Titles.Add("Ms");
            Titles.Add("Dr");
            Title.ItemsSource = Titles;

            //Student details returned
            var student = _client.ReturnStudentDetail(studentId);
            if (student != null)
            {
                _student = student;
                //set information on page of selected student
                Title.SelectedItem = Titles.SingleOrDefault(x => x == _student.StudentTitle);
                Forename.Text = _student.StudentForename;
                Surname.Text = _student.StudentSurname;
                Email.Text = _student.StudentEmail;
                Year.Text = _student.Year.ToString("D");
            }
            //courses list returned
            var courses = _client.ReturnCourses();
            //validation message colour set
            ValidationMessage.Foreground = _alert;
            //course select list population
            if (courses != null)
            {
                //Courses select populated
                foreach (var c in courses)
                {
                    Courses.Add(c.CourseName);
                }
                //student selected course
                var selectedCourse = courses.SingleOrDefault(x => x.CourseId == _student.Course);
                Course.ItemsSource = Courses;
                if (selectedCourse != null)
                {   //setting slected course toreflect student
                    Course.Text = selectedCourse.CourseName;
                }

                return;
            }
            //defaults if student selceted isnt valid
            Title.SelectedItem = "No Selection";
            Forename.Text = "N/A";
            Surname.Text = "N/A";
            Email.Text = "N/A";
            Course.SelectedItem = "N/A";
        }
开发者ID:CfoxQUB,项目名称:DesktopApplication,代码行数:57,代码来源:EditStudent.xaml.cs


示例19: Initialize

        public void Initialize()
        {
            _NavigationService = Model.NavigationService;

            // transit ModeSelectionScreen
            transitionTimer = new DispatcherTimer();
            transitionTimer.Interval = TimeSpan.FromMilliseconds(4000);
            transitionTimer.Tick += new EventHandler(Transition);
            transitionTimer.Start();
        }
开发者ID:uecmappapp,项目名称:UECMapApplication,代码行数:10,代码来源:CautionViewModel.cs


示例20: CleanPageStack

 public static void CleanPageStack(NavigationService srv)
 {
     while (true)
     {
         if (srv.CanGoBack)
             srv.RemoveBackEntry();
         else
             break;
     }
 }
开发者ID:ultrashot,项目名称:xapdeployer,代码行数:10,代码来源:Utils.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Navigation.RequestNavigateEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Navigation.NavigationFailedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap