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


C# Navigation.NavigationService类代码示例

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


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


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