當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。