public DashboardViewModel(IMvxNavigationService navigationService) { _navigationService = navigationService; MyProperty = "This is dashboard viewmodel property"; ButtonText = "GO TO"; OpenNewFragment = new MvxAsyncCommand(ExecuteOpenNewFragmentAsync); }
public LoginViewModel( ILoginManager loginManager, IAnalyticsService analyticsService, IOnboardingStorage onboardingStorage, IMvxNavigationService navigationService, IPasswordManagerService passwordManagerService, IErrorHandlingService errorHandlingService) { Ensure.Argument.IsNotNull(loginManager, nameof(loginManager)); Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService)); Ensure.Argument.IsNotNull(onboardingStorage, nameof(onboardingStorage)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(passwordManagerService, nameof(passwordManagerService)); Ensure.Argument.IsNotNull(errorHandlingService, nameof(errorHandlingService)); this.loginManager = loginManager; this.analyticsService = analyticsService; this.onboardingStorage = onboardingStorage; this.navigationService = navigationService; this.passwordManagerService = passwordManagerService; this.errorHandlingService = errorHandlingService; SignupCommand = new MvxAsyncCommand(signup); GoogleLoginCommand = new MvxCommand(googleLogin); LoginCommand = new MvxCommand(login, () => LoginEnabled); ForgotPasswordCommand = new MvxAsyncCommand(forgotPassword); TogglePasswordVisibilityCommand = new MvxCommand(togglePasswordVisibility); StartPasswordManagerCommand = new MvxAsyncCommand(startPasswordManager, () => IsPasswordManagerAvailable); }
public static async Task TryExecuteAsync <T>(this IMvxAsyncCommand <T> self, T parameter) { if (self.CanExecute(parameter)) { await self.ExecuteAsync(parameter); } }
public MainViewModel(ITranslateService translateService) : base() { TranslateCommand = new MvxAsyncCommand(async() => { TranslatedText = await translateService.Translate(InputText); }); }
public MenuViewModel(IMvxNavigationService navigationService) { _navigationService = navigationService; ShowHomeCommand = new MvxAsyncCommand(NavigateToHomeAsync); ShowSettingsCommand = new MvxAsyncCommand(NavigateToSettingsAsync); }
public MenuViewModel(IMvxNavigationService navigationService) { _navigationService = navigationService; ShowHomeCommand = new MvxAsyncCommand(NavigateToHomeAsync); ShowEventCreateCommand = new MvxAsyncCommand(NavigateToCreateAsync); }
public SignupViewModel( IApiFactory apiFactory, ILoginManager loginManager, IAnalyticsService analyticsService, IOnboardingStorage onboardingStorage, IMvxNavigationService navigationService, IApiErrorHandlingService apiErrorHandlingService) { Ensure.Argument.IsNotNull(apiFactory, nameof(apiFactory)); Ensure.Argument.IsNotNull(loginManager, nameof(loginManager)); Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService)); Ensure.Argument.IsNotNull(onboardingStorage, nameof(onboardingStorage)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(apiErrorHandlingService, nameof(apiErrorHandlingService)); this.apiFactory = apiFactory; this.loginManager = loginManager; this.analyticsService = analyticsService; this.onboardingStorage = onboardingStorage; this.navigationService = navigationService; this.apiErrorHandlingService = apiErrorHandlingService; LoginCommand = new MvxAsyncCommand(login); GoogleSignupCommand = new MvxCommand(googleSignup); PickCountryCommand = new MvxAsyncCommand(pickCountry); SignupCommand = new MvxAsyncCommand(signup, () => SignupEnabled); TogglePasswordVisibilityCommand = new MvxCommand(togglePasswordVisibility); }
//public IMvxAsyncCommand LoginCommand { get; } public LoginViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, Services.IAppSettings settings) : base(logProvider, navigationService) { _navigationService = navigationService; _settings = settings; NavigateToRegistrationPageCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <RegistrationViewModel>()); LoginCommand = new MvxAsyncCommand(async() => await NavigationService.Navigate <SplitRootViewModel>()); }
public MyPostItemViewModel(IMvxNavigationService navigationService, BasePostViewModel post, IMvxAsyncCommand <MyPostItemViewModel> removeCommand) { _navigationService = navigationService; Post = post; _removeCommand = removeCommand; }
/// <summary> /// Initialize a ContentButton /// </summary> /// <param name="label">The label to appear on the button</param> /// <param name="glyph">The button icon</param> /// <param name="isExtended">Should the icon be extended or not</param> /// <param name="clickCommand">Command to run on click</param> public ContentButton(string label, string glyph, bool isExtended, IMvxAsyncCommand <ContentGroup> clickCommand) { Label = label; Glyph = glyph; IsExtended = isExtended; ButtonClickCommand = clickCommand; }
public static async Task TryExecuteAsync(this IMvxAsyncCommand self) { if (self.CanExecute()) { await self.ExecuteAsync(); } }
public BrowserViewModel(IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.navigationService = navigationService; BackCommand = new MvxAsyncCommand(back); }
public HomeViewModel(IMvxNavigationService navigationService, ILocationPromptService locationPromptService, IMvxLog log, IUserDialogs userDialogs) { _navigationService = navigationService; _locationPromptService = locationPromptService; _log = log; _useDialogs = userDialogs; SearchCommandAsync = new MvxAsyncCommand(SearchPropertiesAsync); }
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); }
public SelectDateTimeViewModel(IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.navigationService = navigationService; CloseCommand = new MvxAsyncCommand(close); SaveCommand = new MvxAsyncCommand(save); }
public AuthenticationViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IAuthenticationService authenticationService, IDialogService dialogService) : base(logProvider, navigationService) { _authenticationService = authenticationService; _dialogService = dialogService; CloseCommand = new MvxAsyncCommand(async() => await NavigationService.Close(this)); HandleRequestCommand = new MvxAsyncCommand <string>(HandleRequestAsync); }
public HomeViewModel(IModelFacade modelFacade, IMvxMessenger messenger) : base(modelFacade) { _messenger = messenger; CommandSendMessage = new MvxAsyncCommand(SendMessage); CommandReset = new MvxAsyncCommand(ResetConnection); Results = new MvxObservableCollection <string>(); }
public AboutViewModel(IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.navigationService = navigationService; OpenPrivacyPolicyCommand = new MvxAsyncCommand(openPrivacyPolicyView); OpenTermsOfServiceCommand = new MvxAsyncCommand(openTermsOfServiceView); OpenLicensesCommand = new MvxAsyncCommand(openLicensesView); }
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)); }
public CounterViewModel(ICountersService service, IMvxNavigationService navigationService) { this.navigationService = navigationService; this.service = service; IncrementCommand = new MvxAsyncCommand(IncrementCounter); DeleteCommand = new MvxAsyncCommand(DeleteCounter); SaveCommand = new MvxAsyncCommand(Save); CancelCommand = new MvxAsyncCommand(Cancel); }
public CountersViewModel(ICountersService service, IMvxMessenger messenger, IMvxNavigationService navigationService) { token = messenger .SubscribeOnMainThread <CountersChangedMessage> (async m => await LoadCounters()); this.service = service; this.navigationService = navigationService; ShowAddNewCounterCommand = new MvxAsyncCommand(ShowAddNewCounter); Counters = new ObservableCollection <CounterViewModel>(); }
public MenuViewModel(IMvxNavigationService navigationService) { _navigationService = navigationService; MenuItemList = new MvxObservableCollection <string>() { "Home", "Contacts" }; ShowDetailPageAsyncCommand = new MvxAsyncCommand(ShowDetailPageAsync); }
public PropertiesViewModel(IMvxNavigationService navigationService, ISearchService searchService, IMvxLog log, IUserDialogs userDialogs) { _navigationService = navigationService; _searchService = searchService; _log = log; _useDialogs = userDialogs; ShowPropertyDetailsAsyncCommand = new MvxAsyncCommand <SearchPropertyResult>(ShowPropertyDetailsAsync); LoadMorePropertiesAsyncCommand = new MvxAsyncCommand <SearchPropertyResult>(LoadMorePropertiesAsync); RefreshPropertiesAsyncCommand = new MvxAsyncCommand(RefreshPropertiesAsync); }
public MovieShows(ImageSource imageSource, string title, string genre, string shows, double rating, IMvxAsyncCommand command) { //_basicShowData = showData; ImageSource = imageSource; Title = title; Genre = genre; Shows = shows; Rating = rating; //_navigationService = navigationService; GoToMoviePageCommand = command; }
public SettingsViewModel(ITogglDataSource dataSource, IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Title = Resources.Settings; this.dataSource = dataSource; this.navigationService = navigationService; BackCommand = new MvxAsyncCommand(back); LogoutCommand = new MvxAsyncCommand(logout); }
public SelectDateFormatViewModel(IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.navigationService = navigationService; CloseCommand = new MvxAsyncCommand(close); SelectFormatCommand = new MvxAsyncCommand <SelectableDateFormatViewModel>(selectFormat); DateTimeFormats = availableDateFormats .Select(dateFormat => new SelectableDateFormatViewModel(dateFormat, false)) .ToArray(); }
public TimeEntriesLogViewModel(ITogglDataSource dataSource, ITimeService timeService, IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(timeService, nameof(timeService)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.dataSource = dataSource; this.timeService = timeService; this.navigationService = navigationService; EditCommand = new MvxAsyncCommand <TimeEntryViewModel>(edit); ContinueTimeEntryCommand = new MvxAsyncCommand <TimeEntryViewModel>(continueTimeEntry); }
public EditProjectViewModel(ITogglDataSource dataSource, IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.dataSource = dataSource; this.navigationService = navigationService; DoneCommand = new MvxAsyncCommand(done); CloseCommand = new MvxAsyncCommand(close); PickColorCommand = new MvxAsyncCommand(pickColor); PickClientCommand = new MvxAsyncCommand(pickClient); PickWorkspaceCommand = new MvxAsyncCommand(pickWorkspace); }
public TermsOfServiceViewModel( IBrowserService browserService, IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(browserService, nameof(browserService)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.navigationService = navigationService; this.browserService = browserService; CloseCommand = new MvxAsyncCommand(() => close(false)); AcceptCommand = new MvxAsyncCommand(() => close(true)); ViewPrivacyPolicyCommand = new MvxCommand(viewPrivacyPolicy); ViewTermsOfServiceCommand = new MvxCommand(viewTermsOfService); }
public SelectBeginningOfWeekViewModel(IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.navigationService = navigationService; CloseCommand = new MvxAsyncCommand(close); SelectBeginningOfWeekCommand = new MvxAsyncCommand <SelectableBeginningOfWeekViewModel>(selectFormat); BeginningOfWeekCollection = Enum.GetValues(typeof(BeginningOfWeek)) .Cast <BeginningOfWeek>() .Select(beginningOfWeek => new SelectableBeginningOfWeekViewModel(beginningOfWeek, false)) .ToArray(); }