コード例 #1
0
        public SelectDateTimeViewModel(IMvxNavigationService navigationService)
        {
            Ensure.Argument.IsNotNull(navigationService, nameof(navigationService));

            this.navigationService = navigationService;

            CloseCommand = new MvxAsyncCommand(close);
            SaveCommand  = new MvxAsyncCommand(save);
        }
コード例 #2
0
        public NativeViewModel(IMvxNavigationService navigationService)
        {
            ForwardCommand = new MvxAsyncCommand(
                async() => await navigationService.Navigate <NativeViewModel>().ConfigureAwait(false));
            CloseCommand = new MvxAsyncCommand(
                async() => await navigationService.Close(this).ConfigureAwait(false));

            Description = $"View number {_counter++}";
        }
コード例 #3
0
        public MainViewModel(IMvxNavigationService navigationService, ILoginService iLoginService)
        {
            _navigationService = navigationService;
            _iLoginService     = iLoginService;

            CurrentMainViewCommand = new MvxAsyncCommand(CurrentMainView);
            TestIOSCommand         = new MvxAsyncCommand(async() => await _navigationService.Navigate <TestLoginViewModel>());
            MenuViewCommand        = new MvxAsyncCommand(async() => await _navigationService.Navigate <ListTaskViewModel>());
        }
コード例 #4
0
 public ContactDispatchViewModel(
     IMvxLogProvider logProvider
     , IMvxMessenger messenger
     , IMvxNavigationService navigationService)
     : base(logProvider, navigationService)
 {
     CloseViewModelCommand = new MvxAsyncCommand(async() => await NavigationService.Close(this));
     _messenger            = messenger;
 }
コード例 #5
0
        public DeliveryAddressViewModel(IMvxNavigationService navigationService, IAddressService addressService)
        {
            _navigationService = navigationService;
            _addressService    = addressService;

            CloseCommand = new MvxAsyncCommand(async() => await _navigationService.Close(this));

            AddressList = new MvxObservableCollection <Address>();
        }
コード例 #6
0
        public override void Prepare(Note parameter)
        {
            model            = parameter;
            this.Title       = parameter.Title;
            this.Description = parameter.Description;

            UpdateNoteCommand = new MvxAsyncCommand(UpdateNote);
            RemoveNoteCommand = new MvxAsyncCommand(RemoveNote);
        }
コード例 #7
0
        public HomeViewModel(
            IMvxNavigationService mvxNavigationService
            )
        {
            this.mvxNavigationService = mvxNavigationService;

            RoundButtonClickCommand = new MvxAsyncCommand(RoundButtonClick);
            RoundButtonText         = AppResources.Click;
        }
コード例 #8
0
        public SelectCountryViewModel(IMvxNavigationService navigationService)
        {
            Ensure.Argument.IsNotNull(navigationService, nameof(navigationService));

            this.navigationService = navigationService;

            CloseCommand         = new MvxAsyncCommand(close);
            SelectCountryCommand = new MvxAsyncCommand <SelectableCountryViewModel>(selectCountry);
        }
コード例 #9
0
 public ListTaskViewModel(IMvxNavigationService navigationService, ITaskService iTaskService)
 {
     _navigationService = navigationService;
     _iTaskService      = iTaskService;
     Items                    = new MvxObservableCollection <TaskItem>();
     TaskCreateCommand        = new MvxAsyncCommand <TaskItem>(TaskCreate);
     ShowAboutCommand         = new MvxAsyncCommand(async() => await _navigationService.Navigate <AboutTaskViewModel>());
     ShowMenuViewModelCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <MenuViewModel>());
 }
コード例 #10
0
        public UserListViewModel(IMvxNavigationService navigationService,
                                 IUserService userService
                                 )
        {
            _navigationService = navigationService;
            _userService       = userService;

            AddUserCommand = new MvxAsyncCommand(AddUser);
        }
コード例 #11
0
        public MainViewModel(
            ITogglDataSource dataSource,
            ITimeService timeService,
            IRatingService ratingService,
            IUserPreferences userPreferences,
            IAnalyticsService analyticsService,
            IOnboardingStorage onboardingStorage,
            IInteractorFactory interactorFactory,
            IMvxNavigationService navigationService,
            IRemoteConfigService remoteConfigService,
            ISuggestionProviderContainer suggestionProviders,
            ISchedulerProvider schedulerProvider)
        {
            Ensure.Argument.IsNotNull(dataSource, nameof(dataSource));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotNull(ratingService, nameof(ratingService));
            Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences));
            Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService));
            Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory));
            Ensure.Argument.IsNotNull(onboardingStorage, nameof(onboardingStorage));
            Ensure.Argument.IsNotNull(navigationService, nameof(navigationService));
            Ensure.Argument.IsNotNull(remoteConfigService, nameof(remoteConfigService));
            Ensure.Argument.IsNotNull(suggestionProviders, nameof(suggestionProviders));
            Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider));

            this.dataSource        = dataSource;
            this.timeService       = timeService;
            this.userPreferences   = userPreferences;
            this.analyticsService  = analyticsService;
            this.interactorFactory = interactorFactory;
            this.navigationService = navigationService;
            this.onboardingStorage = onboardingStorage;
            this.schedulerProvider = schedulerProvider;

            SuggestionsViewModel    = new SuggestionsViewModel(dataSource, interactorFactory, onboardingStorage, suggestionProviders);
            RatingViewModel         = new RatingViewModel(timeService, dataSource, ratingService, analyticsService, onboardingStorage, navigationService, schedulerProvider);
            TimeEntriesLogViewModel = new TimeEntriesLogViewModel(timeService, dataSource, interactorFactory, onboardingStorage, analyticsService, navigationService);
            TimeEntriesViewModel    = new TimeEntriesViewModel(dataSource, interactorFactory, analyticsService, schedulerProvider);

            LogEmpty         = TimeEntriesViewModel.Empty.AsDriver(this.schedulerProvider);
            TimeEntriesCount = TimeEntriesViewModel.Count.AsDriver(this.schedulerProvider);

            ratingViewExperiment = new RatingViewExperiment(timeService, dataSource, onboardingStorage, remoteConfigService);

            RefreshCommand                   = new MvxCommand(Refresh);
            OpenReportsCommand               = new MvxAsyncCommand(openReports);
            OpenSettingsCommand              = new MvxAsyncCommand(openSettings);
            OpenSyncFailuresCommand          = new MvxAsyncCommand(openSyncFailures);
            EditTimeEntryCommand             = new MvxAsyncCommand(editTimeEntry, canExecuteEditTimeEntryCommand);
            StopTimeEntryCommand             = new MvxAsyncCommand(stopTimeEntry, () => isStopButtonEnabled);
            StartTimeEntryCommand            = new MvxAsyncCommand(startTimeEntry, () => CurrentTimeEntryId.HasValue == false);
            AlternativeStartTimeEntryCommand = new MvxAsyncCommand(alternativeStartTimeEntry, () => CurrentTimeEntryId.HasValue == false);

            ContinueTimeEntry = new InputAction <TimeEntryViewModel>(continueTimeEntry);
            SelectTimeEntry   = new InputAction <TimeEntryViewModel>(timeEntrySelected);
            RefreshAction     = new UIAction(refresh);
        }
コード例 #12
0
ファイル: MainViewModel.cs プロジェクト: AlexKorota/Phoneword
        public MainViewModel(ITranslationService translationService, IMvxNavigationService navigationService)
        {
            _translationService = translationService;
            _navigationService  = navigationService;

            TranslateCommand   = new MvxCommand(() => Translate(), () => true);
            ShowHistoryCommand = new MvxAsyncCommand(ShowHistoryTask);
            ShowAboutCommand   = new MvxAsyncCommand(async() => await _navigationService.Navigate <AboutViewModel>());
        }
コード例 #13
0
 public CounterViewModel(ICountersService service, IMvxNavigationService navigationService)
 {
     this.service           = service;
     this.navigationService = navigationService;
     IncrementCommand       = new MvxAsyncCommand(IncrementCounter);
     DeleteCommand          = new MvxAsyncCommand(DeleteCounter);
     CancelCommand          = new MvxAsyncCommand(Cancel);
     SaveCommand            = new MvxAsyncCommand(Save);
 }
コード例 #14
0
 public TipViewModel(IMvxNavigationService navigationService, ICalculationService calculationService, IMonkeyService monkeyService)
 {
     _calculationService = calculationService;
     CommandShowList     = new MvxAsyncCommand(asyc => CommandShowListFunction());
     CommandCheckLeak    = new MvxAsyncCommand(asyc => CommandCheckLeakFunction());
     _navigationService  = navigationService;
     _monkeyService      = monkeyService;
     LeakReport          = "---";
 }
コード例 #15
0
        public LoginViewModel(IMvxNavigationService navigationService, IApiService apiService, IUserDialogs userDialogs)
        {
            _navigationService = navigationService;
            _apiService        = apiService;
            _userDialogs       = userDialogs;

            _registerCommand = new MvxAsyncCommand(Register, () => !IsLoading);
            _loginCommand    = new MvxAsyncCommand(Login, () => !IsLoading);
        }
コード例 #16
0
        public NestedChildViewModel(IMvxNavigationService navigationService)
        {
            _navigationService = navigationService;

            CloseCommand      = new MvxAsyncCommand(async() => await _navigationService.Close(this));
            PopToChildCommand = new MvxCommand(() => _navigationService.ChangePresentation(new MvxPopPresentationHint(typeof(ChildViewModel))));
            PopToRootCommand  = new MvxCommand(() => _navigationService.ChangePresentation(new MvxPopToRootPresentationHint()));
            RemoveCommand     = new MvxCommand(() => _navigationService.ChangePresentation(new MvxRemovePresentationHint(typeof(SecondChildViewModel))));
        }
コード例 #17
0
        public MenuViewModel(IMvxNavigationService navigation,
                             IUserDialogs dialogs)
        {
            _navigation = navigation;
            _dialogs    = dialogs;

            CloseMenuCommand = new MvxAsyncCommand(() => _navigation.Close(this));
            LogOutCommand    = new MvxAsyncCommand(LogOut);
        }
コード例 #18
0
        public SessionsViewModel(IMvxNavigationService navigationService)
        {
            PlayTapped         = new Command <Play>(OnItemSelected);
            AddPlayCommand     = new MvxAsyncCommand(AddPlay);
            _navigationService = navigationService;

            Loader = new TaskLoaderNotifier <IEnumerable <SessionGroup> >();
            Loader.RefreshCommand = Loader.ReloadCommand = new MvxAsyncCommand(Load);
        }
コード例 #19
0
        public LoginViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService)
            : base(logProvider, navigationService)
        {
            ValidateUsernameCommand = new MvxCommand(ValidateUsername);
            ValidatePasswordCommand = new MvxCommand(ValidatePassword);

            LoginCommand  = new MvxAsyncCommand(LoginAsync, () => IsValid);
            CancelCommand = new MvxAsyncCommand(CancelAsync);
        }
コード例 #20
0
ファイル: MainViewModel.cs プロジェクト: caupolican/test
        public MainViewModel(
            IMvxNavigationService navigationService,
            IRepository repository)
        {
            _navigationService = navigationService;
            _repository        = repository;

            CreateUserCommand = new MvxAsyncCommand(NavigateAsync);
        }
コード例 #21
0
        public OverrideAttributeViewModel(ILoggerFactory logProvider, IMvxNavigationService navigationService)
            : base(logProvider, navigationService)
        {
            CloseCommand = new MvxAsyncCommand(() => NavigationService.Close(this));

            ShowTabsCommand = new MvxAsyncCommand(() => NavigationService.Navigate <TabsRootViewModel>());

            ShowSecondChildCommand = new MvxAsyncCommand(() => NavigationService.Navigate <SecondChildViewModel>());
        }
コード例 #22
0
 public MapsViewModel(IMvxNavigationService navigationService, ITaskService iTaskService, IMvxMessenger messenger)
 {
     _navigationService        = navigationService;
     _iTaskService             = iTaskService;
     _messenger                = messenger;
     _token                    = messenger.Subscribe <GoogleMapMessenger>(OnLosationMessage);
     BackTaskCommand           = new MvxAsyncCommand(BackGoogleMap);
     SaveGoogleMapPointCommand = new MvxAsyncCommand(SaveGoogleMapPoint);
 }
コード例 #23
0
ファイル: DatabaseViewModel.cs プロジェクト: Templatte/SolPM
        public DatabaseViewModel(IMvxNavigationService navigationService)
        {
            _navigationService = navigationService;

            // Commands

            NavigateVaultView  = new MvxAsyncCommand(() => _navigationService.Navigate <VaultViewModel>());
            CreateVaultCommand = new MvxCommand <VaultParams>((s) => CreateVault(s), (s) => CanCreateVault(s));
        }
コード例 #24
0
        public RootViewModel(IMvxViewModelLoader mvxViewModelLoader)
        {
            _mvxViewModelLoader = mvxViewModelLoader;
            try
            {
                var messenger = Mvx.Resolve <IMvxMessenger>();
                var str       = messenger.ToString();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }


            ShowChildCommand = new MvxAsyncCommand(async() =>
                                                   await NavigationService.Navigate <ChildViewModel, SampleModel>(new SampleModel
            {
                Message = "Hey",
                Value   = 1.23m
            }));

            ShowModalCommand = new MvxAsyncCommand(Navigate);

            ShowModalNavCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <ModalNavViewModel>());

            ShowTabsCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <TabsRootViewModel>());

            ShowSplitCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <SplitRootViewModel>());

            ShowNativeCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <NativeViewModel>());

            ShowOverrideAttributeCommand = new MvxAsyncCommand(async() =>
                                                               await NavigationService.Navigate <OverrideAttributeViewModel>());

            ShowSheetCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <SheetViewModel>());

            ShowWindowCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <WindowViewModel>());

            ShowMixedNavigationCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <MixedNavFirstViewModel>());

            ShowDictionaryBindingCommand = new MvxAsyncCommand(async() =>
                                                               await NavigationService.Navigate <DictionaryBindingViewModel>());

            ShowCollectionViewCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <CollectionViewModel>());

            ShowSharedElementsCommand = new MvxAsyncCommand(async() =>
                                                            await NavigationService.Navigate <SharedElementRootChildViewModel>());

            ShowCustomBindingCommand =
                new MvxAsyncCommand(async() => await NavigationService.Navigate <CustomBindingViewModel>());

            _counter = 3;
        }
コード例 #25
0
 public TrainingsListViewModel(ITrainingService trainingService, IMvxNavigationService navigationService, IMvxViewPresenter viewPresenter)
 {
     this.trainingService               = trainingService;
     this.navigationService             = navigationService;
     this.viewPresenter                 = viewPresenter;
     ShowTrainingDetailPageAsyncCommand = new MvxAsyncCommand(ShowTrainingDetailPageAsync);
     LoadAsyncCommand      = new MvxAsyncCommand(async() => await LoadTrainings());
     CreateTrainingCommand = new MvxAsyncCommand(async() => await this.CreateTraining());
     DeleteTrainingCommand = new MvxAsyncCommand <int>(async(x) => await DeleteTrainingAsync(x));
 }
コード例 #26
0
        public ModalNavViewModel(IMvxNavigationService navigationService)
        {
            _navigationService = navigationService;

            CloseCommand = new MvxAsyncCommand(async() => await _navigationService.Close(this));

            ShowChildCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <ChildViewModel>());

            ShowNestedModalCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <NestedModalViewModel>());
        }
コード例 #27
0
        public ChildViewModel(IMvxNavigationService navigationService)
        {
            _navigationService = navigationService;

            CloseCommand = new MvxAsyncCommand(async() => await _navigationService.Close(this));

            ShowSecondChildCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <SecondChildViewModel>());

            ShowRootCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <RootViewModel>());
        }
コード例 #28
0
        public SplitMasterViewModel(IMvxNavigationService navigationService)
        {
            _navigationService = navigationService;

            OpenDetailCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <SplitDetailViewModel>());

            OpenDetailNavCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <SplitDetailNavViewModel>());

            ShowRootViewModel = new MvxAsyncCommand(async() => await _navigationService.Navigate <RootViewModel>());
        }
コード例 #29
0
        public ModalViewModel(IMvxNavigationService navigationService)
        {
            _navigationService = navigationService;

            ShowTabsCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <TabsRootViewModel>());

            CloseCommand = new MvxAsyncCommand(async() => await _navigationService.Close(this));

            ShowNestedModalCommand = new MvxAsyncCommand(async() => await _navigationService.Navigate <NestedModalViewModel>());
        }
コード例 #30
0
        public AccountsViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IMusicProviderService musicProviderService,
                                 IAuthenticationService authenticationService, IMvxMessenger mvxMessenger) : base(logProvider, navigationService)
        {
            _musicProviderService  = musicProviderService;
            _authenticationService = authenticationService;
            _mvxMessenger          = mvxMessenger;

            CloseCommand  = new MvxAsyncCommand(async() => await NavigationService.Close(this));
            InvokeCommand = new MvxAsyncCommand <MusicProviderAccount>(OnAccountMusicProviderInvoke);
        }
コード例 #31
0
		public LoginViewModel()
		{
			LoginCommand = new MvxAsyncCommand(LoginAsync);
			RegisterCommand = new MvxCommand(() => ShowViewModel<RegisterViewModel>());
			OpenModalCommand = new MvxCommand(() => ShowViewModel<ModalViewModel>());
		}
コード例 #32
0
		public Tab2ViewModel()
		{
			LogoutCommand = new MvxAsyncCommand(LogoutAsync);
		}