本文整理汇总了C#中INavigationService.NavigateTo方法的典型用法代码示例。如果您正苦于以下问题:C# INavigationService.NavigateTo方法的具体用法?C# INavigationService.NavigateTo怎么用?C# INavigationService.NavigateTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INavigationService
的用法示例。
在下文中一共展示了INavigationService.NavigateTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AboutViewModel
public AboutViewModel(GithubService githubService, INavigationService navigationService)
{
Michelsalib = githubService.Load(new UserRequest("michelsalib"), u => Michelsalib = u);
AlbertoMonteiro = githubService.Load(new UserRequest("albertomonteiro"), u => AlbertoMonteiro = u);
Gi7 = githubService.Load(new RepositoryRequest("michelsalib", "Gi7"), r => Gi7 = r);
RepoSelectedCommand = new RelayCommand<Repository>(r =>
{
if (r != null)
navigationService.NavigateTo(String.Format(ViewModelLocator.REPOSITORY_URL, r.Owner.Login, r.Name));
});
UserSelectedCommand = new RelayCommand<User>(user =>
{
if (user != null)
navigationService.NavigateTo(string.Format(ViewModelLocator.USER_URL, user.Login));
});
ShareCommand = new RelayCommand(() =>
{
new ShareLinkTask
{
LinkUri = new Uri("http://www.windowsphone.com/en-US/apps/2bdbe5da-a20a-42f5-8b08-cda2fbf9046f"),
Title = "Check this Github app for Windows Phone 7",
Message = "I found this app that you might like. Check it ou on the Marketplace, it is free!",
}.Show();
});
}
示例2: MainViewModel
public MainViewModel(IDataService dataService, INavigationService navigationService, IDialogService dialogService)
{
this.dataService = dataService;
this.dialogService = dialogService;
Posts = new ObservableCollection<Post>();
RefreshCommand = new RelayCommand(async () => await LoadDataAsync());
NavigateToSettingsCommand = new RelayCommand(() => navigationService.NavigateTo(ViewModelLocator.SettingsPageKey));
NavigateToAboutCommand = new RelayCommand(() => navigationService.NavigateTo(ViewModelLocator.AboutPageKey));
NewsSelectedCommand = new RelayCommand<Post>(p => navigationService.NavigateTo(ViewModelLocator.DetailPageKey, p.ID));
}
示例3: IssueViewModel
public IssueViewModel(GithubService githubService, INavigationService navigationService, string username, string repo, string number)
{
RepoName = String.Format("{0}/{1}", username, repo);
IssueName = "Issue #" + number;
Issue = githubService.Load(new IssueRequest(username, repo, number), i => Issue = i);
CommentsRequest = new IssueCommentsRequest(username, repo, number);
ShareCommand = new RelayCommand(() =>
{
new ShareLinkTask
{
LinkUri = new Uri(Issue.HtmlUrl),
Title = "Issue on" + RepoName + " is on Github: " + Issue.Title,
Message = "I found this issue on Github, you might want to see it: " + Issue.Body,
}.Show();
}, () => Issue != null);
RepoSelectedCommand = new RelayCommand(() => { navigationService.NavigateTo(String.Format(ViewModelLocator.REPOSITORY_URL, username, repo)); });
CommentCommand = new RelayCommand(() =>
{
githubService.Load(new IssueCommentRequest(username, repo, number, Comment), r =>
{
Comment = null;
CommentsRequest = new IssueCommentsRequest(username, repo, number);
});
}, () => githubService.IsAuthenticated && Comment != null && Comment.Trim().Length > 0);
}
示例4: ButtonUploadClick
private void ButtonUploadClick()
{
_navigation = new NavigationService();
_navigation.NavigateTo("CustomNewGame");
Flag = true;
CloseAction(Flag);
}
示例5: TreeViewModel
public TreeViewModel(GithubService githubService, INavigationService navigationService, string username, string repo, string sha, string path)
{
RepoName = String.Format("{0}/{1}", username, repo);
Path = path;
Tree = githubService.Load(new TreeRequest(username, repo, sha), t => Tree = t);
ObjectSelectedCommand = new RelayCommand<GitHubFile>(o =>
{
if (o.Type == "blob")
navigationService.NavigateTo(String.Format(ViewModelLocator.BLOB_URL, username, repo, o.Sha, o.Path));
else
//tree
navigationService.NavigateTo(String.Format(ViewModelLocator.TREE_URL, username, repo, o.Sha, o.Path));
});
}
示例6: FirstViewModel
public FirstViewModel(INavigationService navigationService)
{
if (navigationService == null) throw new ArgumentNullException("navigationService");
_navigationService = navigationService;
NavigationCommand = new RelayCommand(() => { _navigationService.NavigateTo(Locator.SecondPage); });
}
示例7: ButtonFromDBClick
private void ButtonFromDBClick()
{
_navigation = new NavigationService();
_navigation.NavigateTo("NewGame");
Flag = true;
CloseAction(Flag);
}
示例8: MainPageViewModel
public MainPageViewModel(INavigationService navigationService)
{
this.navigationService = navigationService;
this.CurrentUser = Session.CurrentUser;
GoToSerivceRequests = new DelegateCommand((args) =>
{
navigationService.NavigateTo(new Uri("/View/ServiceRequestsPage.xaml", UriKind.Relative));
});
GoToTasks = new DelegateCommand((args) =>
{
navigationService.NavigateTo(new Uri("/View/TasksPage.xaml", UriKind.Relative));
});
GoToArticles = new DelegateCommand((args) =>
{
navigationService.NavigateTo(new Uri("/View/ArticlesPage.xaml", UriKind.Relative));
});
}
示例9: SecondViewModel
public SecondViewModel(INavigationService navigationService)
{
if (navigationService == null) throw new ArgumentNullException("navigationService");
_navigationService = navigationService;
NavigationCommand =
new RelayCommand(() => { _navigationService.NavigateTo(Locator.ThirdPage, Parameter ?? string.Empty); });
}
示例10: MainViewModel
public MainViewModel(TransactionManager transactionManager, INavigationService navigationService)
{
this.navigationService = navigationService;
this.transactionManager = transactionManager;
GoToAddTransactionCommand = new RelayCommand<string>(GoToAddTransaction);
GoToAddAccountCommand = new RelayCommand(() => navigationService.NavigateTo("AddAccountView"));
}
示例11: ViewModelOne
public ViewModelOne(INavigationService navigationService)
{
_navigationService = navigationService;
GoNextPage = new RelayCommand(() =>
{
_navigationService.NavigateTo(ViewModelLocator.SecordPages);
});
}
示例12: WelcomeViewModel
public WelcomeViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
HelloWorld = IsInDesignMode
? "Runs in design mode"
: "Runs in runtime mode";
GotoPage1Command = new RelayCommand(() => _navigationService.NavigateTo("Page1"));
}
示例13: ViewModelTwo
public ViewModelTwo(INavigationService navigatoService)
{
_navigatoService = navigatoService;
GoToBackPage = new RelayCommand(() =>
{
_navigatoService.NavigateTo(ViewModelLocator.FirstPage);
});
}
示例14: NavigateTo
public void NavigateTo( string destination, IDictionary<string, string> parameters, INavigationService navigationService )
{
switch ( destination )
{
case SearchQuery:
navigationService.NavigateTo<MainViewModel, ViewPersonRequest>( new ViewPersonRequest( parameters[SearchQueryParameter] ) );
break;
case ViewPersonQuery:
navigationService.NavigateTo<PersonViewModel, Person>( Person.Parse( parameters ) );
break;
default:
NavigateTo( navigationService );
break;
}
}
示例15: VehicleOverviewViewModel
public VehicleOverviewViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
_helper = new Helper();
StationOverViewCommand = new RelayCommand<Stop>((stop) =>
{
stop.Stationinfo.Id = stop.Time;
Deployment.Current.Dispatcher.BeginInvoke(() => ServiceLocator.Current.GetInstance<StationOverviewViewModel>().Station = stop.Stationinfo);
_navigationService.NavigateTo(ViewModelLocator.StationOverviewPageUri);
});
}