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


C# INavigationService.GoBack方法代码示例

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


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

示例1: ThirdViewModel

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

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

示例2: AddServicePageViewModel

        public AddServicePageViewModel(
            IServicesManager servicesManager,
            INavigationService navigator)
        {
            _servicesManager = servicesManager;
            _navigator = navigator;
            
            Submit = new LambdaCommand(
                _ =>
                {
                    _servicesManager.AddServiceAsync(
                        new ServiceInformation(
                            string.IsNullOrEmpty(ServiceName) ? DefaultServiceName : ServiceName,
                            new PasswordRestriction(
                                CollectSymbolTypes(),
                                PasswordMinLength,
                                PasswordMaxLength)));

                    _navigator.GoBack();
                });
        
            ServiceName = DefaultServiceName;
            PasswordMinLength = PasswordRestriction.DefaultMinLength;
            PasswordMaxLength = PasswordRestriction.DefaultMaxLength;
            AllowLowLatin = true;
            AllowUpperLatin = true;
        }
开发者ID:PatriosTheGreat,项目名称:PgenUWP,代码行数:27,代码来源:AddServicePageViewModel.cs

示例3: HubPageViewModel

        public HubPageViewModel(INavigationService navigationService, IPasswordRepository passwordRepository)
        {
            _navigationService = navigationService;
            _passwordRepository = passwordRepository;

            _passwordGroups = new ObservableCollection<PasswordGroup>();

            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                PasswordGroups.Add(new PasswordGroup()
                {
                    GroupKey = "A"
                });
                PasswordGroups.Add(new PasswordGroup()
                {
                    GroupKey = "C"
                });
                PasswordGroups.Add(new PasswordGroup()
                {
                    GroupKey = "D"
                });
            }
            else
            {
                GetData();
            }

            AddNewPasswordCommand = new DelegateCommand(() => AddNewPassword());
            DeleteCommand = new DelegateCommand(() => Delete());
            CopyToClipboardCommand = new DelegateCommand(() => CopyToClipboard());
            GoBackCommand = new DelegateCommand(() => _navigationService.GoBack(), () => _navigationService.CanGoBack());
        }
开发者ID:hvining,项目名称:PasswordManager,代码行数:32,代码来源:HubPageViewModel.cs

示例4: Page1ViewModel

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

示例5: SetupNavigationService

        public void SetupNavigationService(Frame frame)
        {
            _navigationService = _container.RegisterNavigationService(frame);

            var navigationManager = SystemNavigationManager.GetForCurrentView();
            navigationManager.BackRequested += (a, b) => { if (_navigationService.CanGoBack) _navigationService.GoBack(); };
            _navigationService.Navigated += _navigationService_Navigated;

            _navigationService.For<GraphsViewModel>().Navigate();
        }
开发者ID:GreatChieftain,项目名称:Graph-Helper,代码行数:10,代码来源:ShellViewModel.cs

示例6: PersonDetailPageViewModel

 public PersonDetailPageViewModel(IPersonRepository personRepository, INavigationService navService, IEventAggregator eventAggregator) {
     _personRepository = personRepository;
     _navService = navService;
     _eventAggregator = eventAggregator;
     GoBackCommand = new DelegateCommand(
         () => _navService.GoBack(),
         () => _navService.CanGoBack());
     NewPersonCommand = new DelegateCommand(OnNewPerson, CanNewPerson);
     UpdatePersonCommand = new DelegateCommand(OnUpdatePerson, CanUpdatePerson);
     DeletePersonCommand = new DelegateCommand(OnDeletePerson, CanDeletePerson);
     TextBoxLostFocusAction = OnTextBoxLostFocusAction;
 }
开发者ID:ronlemire2,项目名称:PrismRT-CodeGen-v2.1,代码行数:12,代码来源:PersonDetailPageViewModel.cs

示例7: StateDetailPageViewModel

 public StateDetailPageViewModel(IStateRepository stateRepository, INavigationService navService, IEventAggregator eventAggregator) {
     _stateRepository = stateRepository;
     _navService = navService;
     _eventAggregator = eventAggregator;
     GoBackCommand = new DelegateCommand(
         () => _navService.GoBack(),
         () => _navService.CanGoBack());
     NewStateCommand = new DelegateCommand(OnNewState, CanNewState);
     UpdateStateCommand = new DelegateCommand(OnUpdateState, CanUpdateState);
     DeleteStateCommand = new DelegateCommand(OnDeleteState, CanDeleteState);
     TextBoxLostFocusAction = OnTextBoxLostFocusAction;
 }
开发者ID:ronlemire2,项目名称:PrismRT-CodeGen-v2.1,代码行数:12,代码来源:StateDetailPageViewModel.cs

示例8: EntityDetailPageViewModel

 public EntityDetailPageViewModel(IEntityRepository entityRepository, INavigationService navService, IEventAggregator eventAggregator) {
     _entityRepository = entityRepository;
     _navService = navService;
     _eventAggregator = eventAggregator;
     GoBackCommand = new DelegateCommand(
         () => _navService.GoBack(),
         () => _navService.CanGoBack());
     NewEntityCommand = new DelegateCommand(OnNewEntity, CanNewEntity);
     UpdateEntityCommand = new DelegateCommand(OnUpdateEntity, CanUpdateEntity);
     DeleteEntityCommand = new DelegateCommand(OnDeleteEntity, CanDeleteEntity);
     TextBoxLostFocusAction = OnTextBoxLostFocusAction;
 }
开发者ID:ronlemire2,项目名称:PrismRT-CodeGen-v2,代码行数:12,代码来源:EntityDetailPageViewModel.cs

示例9: AddPageViewModel

        public AddPageViewModel(INavigationService navigationService, IEventAggregator eventAggregator)
        {
            _navigationService = navigationService;
            _eventAggregator = eventAggregator;

            SaveCommand = new DelegateCommand(() =>
            {
                Person person = new Person
                {
                    Name = this.Name,
                    Surname = this.Surname
                };

                _eventAggregator.GetEvent<AddPersonEvent>().Publish(person);
                _navigationService.GoBack();
            });
        }
开发者ID:lab4utest,项目名称:Prism-UniversalSample,代码行数:17,代码来源:AddPageViewModel.cs

示例10: GeneratePasswordPageViewModel

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

            _sessionStateService = sessionStateService;
            _service = null;
            _servicePassword = null;

            GenerateServicePassword = new LambdaCommand(
                parameter =>
                {
                    var password = parameter as string;
                    if (password?.Length > 0)
                    {
                        ServicePassword = ServicePasswordGenerator.GeneratePassword(
                            Service,
                            password);
                    }
                },
                _ => Service != null);

            CopyServicePassword = new LambdaCommand(
                _ =>
                {
                    _dataPackage.SetText(ServicePassword);
                    Clipboard.SetContent(_dataPackage);
                },
                _ => ServicePassword?.Length > 0);

            RemoveService = new LambdaCommand(
                _ =>
                {
                    servicesManager.RemoveServiceAsync(Service.UniqueToken);
                    navigationService.GoBack();
                });
        }
开发者ID:PatriosTheGreat,项目名称:PgenUWP,代码行数:39,代码来源:GeneratePasswordPageViewModel.cs

示例11: CancelSeries

        public static async Task<bool> CancelSeries(string seriesId, INavigationService navigationService, IApiClient apiClient, ILog log, bool goBack)
        {
            try
            {
                await apiClient.CancelLiveTvSeriesTimerAsync(seriesId);

                Messenger.Default.Send(new NotificationMessage(seriesId, Constants.Messages.LiveTvSeriesDeletedMsg));

                if (navigationService.CanGoBack && goBack)
                {
                    navigationService.GoBack();
                }

                return true;
            }
            catch (HttpException ex)
            {
                Utils.HandleHttpException(ex, "CancelSeriesRecording", navigationService, log);
                MessageBox.Show(AppResources.ErrorDeletingSeriesRecording, AppResources.ErrorTitle, MessageBoxButton.OK);
            }

            return false;
        }
开发者ID:gep13,项目名称:Emby.WindowsPhone,代码行数:23,代码来源:LiveTvHelper.cs

示例12: AddEditPasswordViewModel

        public AddEditPasswordViewModel(INavigationService navigationService, IPasswordRepository passwordRepository)
        {
            _navigationService = navigationService;
            _passwordRepository = passwordRepository;

            SaveCommand = new DelegateCommand(() => Save(), () => CanSave);
            CopyToClipboardCommand = new DelegateCommand(() => CopyToClipboard());
            GoBackCommand = new DelegateCommand(() => navigationService.GoBack(), () => navigationService.CanGoBack());

            KeyPressAction = (eventArgs) =>
                {
                    switch (eventArgs.Key)
                    {
                        case VirtualKey.Enter:
                            {
                                if(CanSave)
                                    SaveCommand.Execute();
                            }
                            break;
                        default:
                            break;
                    }
                };
        }
开发者ID:hvining,项目名称:PasswordManager,代码行数:24,代码来源:AddEditPasswordViewModel.cs

示例13: AddAccountViewModel

        public AddAccountViewModel(ConnectionService connectionService, AccountService accountService, INavigationService navigationService) {
            _connectionService = connectionService;
            _accountService = accountService;
            _navigationService = navigationService;

            AnonymousAccess = false;
            IsHostValid = false;

            CheckHostCommand = new RelayCommand(async () => {
                // TODO: check if really changed
                IsHostValid = false;
                var host = Host;
                if (!host.EndsWith("/")) host = host + "/";

                _connectionInfo = await _connectionService.GetConnectionInfo(host);
                if (_connectionInfo != null) {
                    var auth = await _connectionService.GetAuthenticationInfo(_connectionInfo);
                    if (auth != AuthenticationMethod.Unknown)
                        IsHostValid = true;
                    AnonymousAccess = auth == AuthenticationMethod.None;
                }
            });

            AddAccountCommand = new RelayCommand(async () => {
                var newAccount = new Account {
                    IsAnonymous = AnonymousAccess,
                    Protocol = _connectionInfo.WebDAVUrl.Scheme,
                    ServerDomain = _connectionInfo.WebDAVUrl.Host,
                    WebDAVPath = _connectionInfo.WebDAVUrl.LocalPath
                };

                if (!AnonymousAccess) {
                    newAccount.UsernamePlain = UserName;
                    newAccount.PasswordPlain = Password;
                    await _accountService.UpdateCredentials(newAccount);
                }
                _accountService.AddAccount(newAccount);
                await _accountService.SaveAccounts();

                if (_navigationService.CanGoBack)
                    _navigationService.GoBack();
                else
                    _navigationService.Navigate(typeof(MainPage));
            }, () => IsHostValid &&
                        (AnonymousAccess ||
                        (!string.IsNullOrWhiteSpace(UserName) &&
                             !string.IsNullOrEmpty(Password))));
        }
开发者ID:rs22,项目名称:windows-phone,代码行数:48,代码来源:AddAccountViewModel.cs

示例14: SettingsViewModel

 /// <summary>
 /// Initializes a new instance of the <see cref="SettingsViewModel"/> class.
 /// </summary>
 /// <param name="dialogService">Dialog service instance.</param>
 /// <param name="navigationService">Navigation service instance.</param>
 /// <param name="msHealthClient">Microsoft Health service instance.</param>
 /// <param name="nikePlusClient">Nike+ service instance.</param>
 public SettingsViewModel(IDialogService dialogService, INavigationService navigationService, IMSHealthClient msHealthClient, INikePlusClient nikePlusClient)
 {
     // Initialize services
     moDialogService = dialogService;
     moNavigationService = navigationService;
     moMSHealthClient = msHealthClient;
     moNikePlusClient = nikePlusClient;
     // Initialize commands
     SignInMSHealthCommand = new RelayCommand(SignInMSHealth, () => true);
     SignOutMSHealthCommand = new RelayCommand(SignOutMSHealth, () => true);
     NavigationCompletedCommand = new RelayCommand<object>(NavigationCompleted, (args) => true);
     ValidateNikePlusCredentialCommand = new RelayCommand(ValidateNikePlusCredential,
         () => !string.IsNullOrEmpty(NikePlusUser) && !string.IsNullOrEmpty(NikePlusPassword));
     ClearNikePlusCredentialCommand = new RelayCommand(ClearNikePlusCredential,
         () => !string.IsNullOrEmpty(NikePlusUser) && !string.IsNullOrEmpty(NikePlusPassword));
     // Get AppVersion
     Package loPackage = Package.Current;
     PackageId loPackageId = loPackage.Id;
     PackageVersion loPackageVersion = loPackageId.Version;
     AppVersion = string.Format("v{0}.{1}.{2}.{3}",
                                loPackageVersion.Major,
                                loPackageVersion.Minor,
                                loPackageVersion.Build,
                                loPackageVersion.Revision);
     // Handle Back button requests
     SystemNavigationManager.GetForCurrentView().BackRequested += (s, e) =>
     {
         e.Handled = true;
         IsRunningRequest = false;
         IsMSHealthRunning = false;
         if (ShowSignIn)
         {
             ShowSignIn = false;
         }
         else
         {
             moNavigationService.GoBack();
         }
     };
 }
开发者ID:yorchideas,项目名称:XportBand,代码行数:47,代码来源:SettingsViewModel.cs

示例15: PlaylistViewModel

        public PlaylistViewModel()
        {
            navigationService = SimpleIoc.Default.GetInstance<INavigationService>();

            //PalyerMediaOpenedCommand = new RelayCommand(() =>
            //{
            //    int i = 5;
            //});

            BackButtonCommand = new RelayCommand(() =>
            {
                AniTubeData.SetSeekPosition(SelectedFilm, PlayerPosition, FilmList);
                AniTubeData.SaveFilmList(PlSelected, FilmList);
                navigationService.GoBack();
            });

            PositionChangedCommand = new RelayCommand(() =>
            {
                FilmList[FilmList.IndexOf(SelectedFilm)].ProgressPercent = Math.Round((PlayerPosition.TotalSeconds)
                    / Convert.ToSingle(PlayerEndTime.TotalSeconds) * 100, 2);
            });

            IsFullScreenCommand = new RelayCommand(() =>
            {
                if (PlayerFullScren)
                {
                    PlayerFullScren = false;
                }
                else
                {
                    PlayerFullScren = true;
                }
                SetPlayerFullScreen();
            });

            ButtonSetFavorite = new RelayCommand(() =>
            {
                AniTubeData.SetFavorites(PlSelected);
                ButtonFavoritesVisibility(PlSelected.isFavorite);
            });

            Messenger.Default.Register<bool>(this, "videoQuality", (message) =>
            {
                IsHD = message;
            });

            Messenger.Default.Register<Playlist>(this, "plToken", (message) =>
                {
                    PlSelected = message;
                    LoadPageData();
                });
            ItemSelectedCommand = new RelayCommand<Film>((film) =>
            {
                AniTubeData.SetSeekPosition(SelectedFilm, PlayerPosition, FilmList);
                SelectedFilm = film;
                SetVidoSource();
                AniTubeData.SetLastPlayed(SelectedFilm, FilmList);
            });
        }
开发者ID:FilippovAlexey,项目名称:project-0998,代码行数:59,代码来源:PlaylistViewModel.cs


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