本文整理汇总了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();
}
示例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));
}
};
}
示例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);
});
}
示例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));
}
示例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);
}
示例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());
}
示例7: MainPageViewModel
public MainPageViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
GoToPortraitPageCommand = new DelegateCommand(() =>
{
_navigationService.Navigate("Portrait", null);
});
GoToMinimumWidthPageCommand = new DelegateCommand(() =>
{
_navigationService.Navigate("MinimumWidth", null);
});
}
示例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();
}
示例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();
}
示例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);
});
}
示例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));
}
示例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);
}
});
}
示例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));
}
示例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";
}
示例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));
}