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


C# INavigationService.NavigateTo方法代码示例

本文整理汇总了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();
            });
        }
开发者ID:KonradIT,项目名称:Gi7,代码行数:26,代码来源:AboutViewModel.cs

示例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));
        }
开发者ID:arnaudmaichac,项目名称:WindowsPhoneAddict,代码行数:12,代码来源:MainViewModel.cs

示例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);
        }
开发者ID:KonradIT,项目名称:Gi7,代码行数:29,代码来源:IssueViewModel.cs

示例4: ButtonUploadClick

 private void ButtonUploadClick()
 {
     _navigation = new NavigationService();
     _navigation.NavigateTo("CustomNewGame");
     Flag = true;
     CloseAction(Flag);
 }
开发者ID:TanyaFox,项目名称:ProjectPuzzleGame,代码行数:7,代码来源:BeforeNewGameWindowViewModel.cs

示例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));
            });
        }
开发者ID:michelsalib,项目名称:Gi7,代码行数:16,代码来源:TreeViewModel.cs

示例6: FirstViewModel

        public FirstViewModel(INavigationService navigationService)
        {
            if (navigationService == null) throw new ArgumentNullException("navigationService");
            _navigationService = navigationService;

            NavigationCommand = new RelayCommand(() => { _navigationService.NavigateTo(Locator.SecondPage); });
        }
开发者ID:Marc-K-Plewka,项目名称:MvvmLightNavigation.XamarinForms,代码行数:7,代码来源:FirstViewModel.cs

示例7: ButtonFromDBClick

 private void ButtonFromDBClick()
 {
     _navigation = new NavigationService();
     _navigation.NavigateTo("NewGame");
     Flag = true;
     CloseAction(Flag);
 }
开发者ID:TanyaFox,项目名称:ProjectPuzzleGame,代码行数:7,代码来源:BeforeNewGameWindowViewModel.cs

示例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));
     });
 }
开发者ID:realgwyn,项目名称:profesal-wp7,代码行数:17,代码来源:MainPageViewModel.cs

示例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); });
        }
开发者ID:Marc-K-Plewka,项目名称:MvvmLightNavigation.XamarinForms,代码行数:8,代码来源:SecondViewModel.cs

示例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"));
        }
开发者ID:gitter-badger,项目名称:MoneyManager,代码行数:8,代码来源:MainViewModel.cs

示例11: ViewModelOne

 public ViewModelOne(INavigationService navigationService)
 {
     _navigationService = navigationService;
     GoNextPage = new RelayCommand(() =>
     {
         _navigationService.NavigateTo(ViewModelLocator.SecordPages);
     });
 }
开发者ID:EmptyBucket,项目名称:NavigationServiceMVVMPattern,代码行数:8,代码来源:ViewModelOne.cs

示例12: WelcomeViewModel

 public WelcomeViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     HelloWorld = IsInDesignMode
         ? "Runs in design mode"
         : "Runs in runtime mode";
     GotoPage1Command = new RelayCommand(() => _navigationService.NavigateTo("Page1"));
 }
开发者ID:GromHSCR,项目名称:SencePot,代码行数:8,代码来源:WelcomeViewModel.cs

示例13: ViewModelTwo

 public ViewModelTwo(INavigationService navigatoService)
 {
     _navigatoService = navigatoService;
     GoToBackPage = new RelayCommand(() =>
     {
         _navigatoService.NavigateTo(ViewModelLocator.FirstPage);
     });
 }
开发者ID:EmptyBucket,项目名称:NavigationServiceMVVMPattern,代码行数:8,代码来源:ViewModelTwo.cs

示例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;
            }
        }
开发者ID:ValentinMinder,项目名称:pocketcampus,代码行数:17,代码来源:Plugin.cs

示例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);
     });
 }
开发者ID:JanJoris,项目名称:Track,代码行数:11,代码来源:VehicleOverViewViewModel.cs


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