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


C# INavigationService.Navigate方法代码示例

本文整理汇总了C#中INavigationService.Navigate方法的典型用法代码示例。如果您正苦于以下问题:C# INavigationService.Navigate方法的具体用法?C# INavigationService.Navigate怎么用?C# INavigationService.Navigate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INavigationService的用法示例。


在下文中一共展示了INavigationService.Navigate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ServicesPageViewModel

        public ServicesPageViewModel(
            IServicesManager servicesManager, 
            INavigationService navigationService,
            ISessionStateService sessionStateService)
        {
            Contract.Assert(servicesManager != null);
            Contract.Assert(navigationService != null);
            Contract.Assert(sessionStateService != null);

            _dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            _servicesManager = servicesManager;
            _sessionStateService = sessionStateService;
            Services = new ObservableCollection<ServiceInformation>();
            NavigateToService = new LambdaCommand(
                parameter =>
                {
                    Contract.Assert(parameter is ServiceInformation);

                    if (_sessionStateService.SessionState.ContainsKey(nameof(ServiceInformation)))
                    {
                        _sessionStateService.SessionState.Remove(nameof(ServiceInformation));
                    }

                    _sessionStateService.SessionState.Add(nameof(ServiceInformation), parameter);
                    navigationService.Navigate(PageTokens.GeneratePassword, null);
                });

            NavigateToAddService = new LambdaCommand(_ => navigationService.Navigate(PageTokens.AddService, null));

            _servicesManager.ServicesUpdated += ResetServicesSync;

            ResetServicesSync();
        }
开发者ID:PatriosTheGreat,项目名称:PgenUWP,代码行数:33,代码来源:ServicesPageViewModel.cs

示例2: SplashPage

 public SplashPage()
 {
     navigation = SimpleIoc.Default.GetInstance<INavigationService>();
     authentication = SimpleIoc.Default.GetInstance<IAuthenticationService>();
     settings = SimpleIoc.Default.GetInstance<ISettingsService>();
     //settings.ClearSettings();
     this.InitializeComponent();
     Loaded +=  async (s, e) =>
     {
         if (settings.Username != null && settings.Password != null)
         {
             if (settings.AccessToken != null)
             {
                 if (settings.ExpiresAt > DateTime.Now)
                 {
                     navigation.Navigate(typeof(HubPage));
                 }
                 else
                 {
                     await LoginAsync();
                 }
             }
             else
             {
                 await LoginAsync();
             }
         }
         else
         {
             navigation.Navigate(typeof(LoginPage));
         }
     };
 }
开发者ID:robertiagar,项目名称:podcastr,代码行数:33,代码来源:SplashPage.xaml.cs

示例3: MainPageViewModel

        public MainPageViewModel(IDataRepository citiesRepository, INavigationService navigation, IEventAggregator eventAggregator)
        {
            _citiesRepository = citiesRepository;
            _navigation = navigation;
            _eventAggregator = eventAggregator;
            var clocks = _citiesRepository.GetUsersCities();
            Clocks = new ObservableCollection<CityInfo>(clocks);
            _eventAggregator.GetEvent<AddCityMessage>().Subscribe(HandleAddCity, true);
            _eventAggregator.GetEvent<DeleteCityMessage>().Subscribe(HandleDeleteCity, true);

            Add = new RelayCommand(() =>
            {
                _navigation.Navigate(Experiences.CitySelector.ToString(), null);
            });
            Donate = new RelayCommand(() => Launcher.LaunchUriAsync(new Uri("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UFS2JX3EJGU3N")));
            GoToDetails = new DelegateCommand<CityInfo>(HandleGotoDetails);
            SetShowMenu = new RelayCommand(() =>
            {
                MenuActive = !MenuActive;
            });
            GoToSettings = new RelayCommand(() =>
            {
                _navigation.Navigate(Experiences.Settings.ToString(), null);
            });
        }
开发者ID:BerserkerDotNet,项目名称:UniversalWorldClock,代码行数:25,代码来源:MainPageViewModel.cs

示例4: MainPageViewModel

        public MainPageViewModel(INavigationService navigationService)
        {
            this.navigationService = navigationService;

            // vytvoreno pomoci https://reswcodegen.codeplex.com/
            NavigateToLogin = new DelegateCommand(() => navigationService.Navigate(PageTokens.LoginPage, null));
            NavigateToReg = new DelegateCommand(() => navigationService.Navigate(PageTokens.RegPage, null));
        }
开发者ID:xkello00,项目名称:ITU-savci,代码行数:8,代码来源:MainPageViewModel.cs

示例5: MainMenuViewModel

 public MainMenuViewModel()
 {
     NavigationService = new NavigationService();
     //mogu se i obe metode u relaycommand staviti inline
     //plus je da se ne mora se pisati metoda, minus kad se radi debug tesko je debagirati tacno dio koji poziva metodu 
     Contact = new RelayCommand<object>((object parametar) => NavigationService.Navigate(typeof(ComunicationView)), (object parametar) => true);
     Gps = new RelayCommand<object>((object parametar) => NavigationService.Navigate(typeof(GpsView)), (object parametar) => true);
     Accel = new RelayCommand<object>((object parametar) => NavigationService.Navigate(typeof(AccelView)), (object parametar) => true);
 }
开发者ID:ooad-2015-2016,项目名称:Obavijesti,代码行数:9,代码来源:MainMenuViewModel.cs

示例6: AdminTestAddPageViewModel

        public AdminTestAddPageViewModel(INavigationService navigationService)
        {
            _navigationService = navigationService;
            service = new DatabaseServiceClient();

            NavigateToAdminUsers = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminUsersPage, null));
            NavigateToAdminTests = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminTestsPage, null));
            NavigateToAdminQues = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminQuestsPage, null));
            NavigateToAdminResults = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminResultsPage, null));

            AddTestBtn = new DelegateCommand(() => AddTestFunc());
        }
开发者ID:xkello00,项目名称:ITU-savci,代码行数:12,代码来源:AdminTestAddPageViewModel.cs

示例7: MainPageViewModel

        public MainPageViewModel(INavigationService navigationService)
        {
            _navigationService = navigationService;
            GoToPortraitPageCommand = new DelegateCommand(() =>
            {
                _navigationService.Navigate("Portrait", null);
            });

            GoToMinimumWidthPageCommand = new DelegateCommand(() =>
            {
                _navigationService.Navigate("MinimumWidth", null);
            });
        }
开发者ID:lab4utest,项目名称:Prism-UniversalSample,代码行数:13,代码来源:MainPageViewModel.cs

示例8: AdminUsersPageViewModel

        public AdminUsersPageViewModel(INavigationService navigationService, MainPage mainPage)
        {
            _navigationService = navigationService;
            service = new DatabaseServiceClient();

            NavigateToAdminUsers = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminUsersPage, null));
            NavigateToAdminTests = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminTestsPage, null));
            NavigateToAdminQues = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminQuestsPage, null));
            NavigateToAdminResults = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminResultsPage, null));

            RemoveUserBtn = new DelegateCommand(() => RemoveUserFunc());

            LoadUsersAsync();
        }
开发者ID:xkello00,项目名称:ITU-savci,代码行数:14,代码来源:AdminUsersPageViewModel.cs

示例9: AdminResultsPageViewModel

        public AdminResultsPageViewModel(INavigationService navigationService, MainPage mainPage)
        {
            _navigationService = navigationService;
            service = new DatabaseServiceClient();

            NavigateToAdminUsers = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminUsersPage, null));
            NavigateToAdminTests = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminTestsPage, null));
            NavigateToAdminQues = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminQuestsPage, null));
            NavigateToAdminResults = new DelegateCommand(() => navigationService.Navigate(PageTokens.AdminResultsPage, null));

            //RemoveQuestion = new DelegateCommand<int>((argument) => RemoveTestFunc(argument));
            RemoveResult = new DelegateCommand(() => RemoveResultFunc());

            LoadResultsAsync();
        }
开发者ID:xkello00,项目名称:ITU-savci,代码行数:15,代码来源:AdminResultsPageViewModel.cs

示例10: MainViewModel

        public MainViewModel(AccountService accountService, INavigationService navigationService) {
            _accountService = accountService;
            _navigationService = navigationService;

            if (IsInDesignMode)
                LoadData();

            AddAccountCommand = new RelayCommand(() => {
                _navigationService.Navigate(typeof(AddAccountPage));
            });

            BrowseAccountCommand = new RelayCommand<Account>(account => {
                _navigationService.Navigate(typeof(BrowsePage), account);
            });
        }
开发者ID:rs22,项目名称:windows-phone,代码行数:15,代码来源:MainViewModel.cs

示例11: PhoneCallListPageViewModel

  public PhoneCallListPageViewModel(IPhoneCallRepository phoneCallRepository, INavigationService navService, IEventAggregator eventAggregator) {
      _phoneCallRepository = phoneCallRepository;
      _navService = navService;
      _eventAggregator = eventAggregator;
      NavCommand = new DelegateCommand<PhoneCall>(OnNavCommand);
      PhoneCallDetailNavCommand = new DelegateCommand(() => _navService.Navigate("PhoneCallDetail", 0));
 }
开发者ID:ronlemire2,项目名称:PrismRT-CodeGen-v2,代码行数:7,代码来源:PhoneCallListPageViewModel.cs

示例12: MainViewModel

        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        /// <param name="navigationService">
        /// The navigation Service.
        /// </param>
        /// <param name="logManager">
        /// The log manager.
        /// </param>
        /// <param name="sessionService">The session service.</param>
        public MainViewModel(INavigationService navigationService, 
            ILogManager logManager, 
            ISessionService sessionService)
        {
            _navigationService = navigationService;
            _logManager = logManager;
            _sessionService = sessionService;
            LogoutCommand = new RelayCommand(
                () =>
                {
                    _sessionService.Logout();

                    // todo navigation
                    _navigationService.Navigate<LoginView>();
                });
            AboutCommand = new RelayCommand(
                async () =>
                { 
                    Exception exception = null;
                    try
                    {
                        // todo navigation
                        // _navigationService.Navigate(new Uri(Constants.AboutView, UriKind.Relative));
                    }
                    catch (Exception ex)
                    {
                        exception = ex;
                    }

                    if (exception != null)
                    {
                        await _logManager.LogAsync(exception);
                    }
                });
        }
开发者ID:Aadeelyoo,项目名称:MyMSDNSamples,代码行数:45,代码来源:MainViewModel.cs

示例13: StateListPageViewModel

  public StateListPageViewModel(IStateRepository stateRepository, INavigationService navService, IEventAggregator eventAggregator) {
      _stateRepository = stateRepository;
      _navService = navService;
      _eventAggregator = eventAggregator;
      NavCommand = new DelegateCommand<State>(OnNavCommand);
      StateDetailNavCommand = new DelegateCommand(() => _navService.Navigate("StateDetail", 0));
 }
开发者ID:ronlemire2,项目名称:PrismRT-CodeGen-v2.1,代码行数:7,代码来源:StateListPageViewModel.cs

示例14: MeetingListViewModel

        public MeetingListViewModel(IAgentConnection connection,
                                    INavigationService navigation,
                                    IMeetingViewModelFactory meetingFactory)
        {
            // Enable the command once a meeting has been selected
            var enter = new ReactiveCommand(this.WhenAnyValue(v => v.SelectedMeeting, sm => sm != null));
            
            // Call the navigate method passing in the selected meeting
            _enterMeetingSub = enter
                .RegisterAsyncAction(_ => navigation.Navigate(Screen.AgentMeeting, SelectedMeeting))
                .Subscribe();
            EnterMeetingCommand = enter;

            _meetingStatusSub = connection.MeetingStatus.ObserveOn(RxApp.MainThreadScheduler).Subscribe(UpdateStatuses);

            // When we get a new list of meetings, add them to our list while suppressing changes
            _meetingUpdateSub = connection.Meetings
                .ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(meetings =>
                            {
                                using (_meetings.SuppressChangeNotifications())
                                {
                                    var toAdd = meetings
                                        .Select(meetingFactory.Create)
                                        .ToArray();

                                    _meetings.Clear();
                                    _meetings.AddRange(toAdd);
                                }
                            });

            Title = "Upcoming Appointments";
        }
开发者ID:reactiveui-forks,项目名称:VirtualSales,代码行数:33,代码来源:MeetingListViewModel.cs

示例15: HeadPageViewModel

        public HeadPageViewModel(
            IEventAggregator events,
            MouthViewModel mouth,
            RightEyeViewModel rightEye,
            LeftEyeViewModel leftEye,
            NoseViewModel nose, 
            INavigationService navService,
            MotionActivatedSimpleAnimation animation)
        {
            _events = events;
            _actionFacialCodingEventToken = _events.GetEvent<Events.ActionFacialCodingEvent>().Subscribe((args) =>
            {
                this.OnActionFacialCodingCommand(args);
            }, ThreadOption.UIThread);

            _sensorChangedEventToken = _events.GetEvent<Events.RangeSensorEvent>().Subscribe((args) =>
            {
                this.OnRangeSensorChanged(args);
            }, ThreadOption.UIThread);


            _navService = navService;
            GoBackCommand = new DelegateCommand(_navService.GoBack);
            NavigateControlCommand = new DelegateCommand(() => navService.Navigate("Control", null));
            HideCommand = new DelegateCommand(this.Hide);

            _mouth = mouth;
            _rightEye = rightEye;
            _leftEye = leftEye;
            _nose = nose;
            _animationService = animation;
            Image = new BitmapImage(new Uri(@"ms-appx:///Assets/pumpkinbackground.png", UriKind.RelativeOrAbsolute));

        }
开发者ID:mlinnen,项目名称:Hackster.io.Pumpkin,代码行数:34,代码来源:HeadPageViewModel.cs


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