public SelectColorViewModel(IMvxNavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; this.rxActionFactory = rxActionFactory; // Public properties Hue = hue.AsObservable(); Saturation = saturation.AsObservable(); Value = value.AsObservable(); Save = rxActionFactory.FromAsync(save); Close = rxActionFactory.FromAsync(close); SetHue = rxActionFactory.FromAction <float>(hue.OnNext); SetSaturation = rxActionFactory.FromAction <float>(saturation.OnNext); SetValue = rxActionFactory.FromAction <float>(value.OnNext); SelectColor = rxActionFactory.FromAction <MvxColor>(selectColor); customColor = Observable .CombineLatest(hue, saturation, value, Color.FromHSV) .Do(selectedColor.OnNext); var availableColors = Observable.Return(Color.DefaultProjectColors) .CombineLatest(customColor, combineAllColors); SelectableColors = availableColors .CombineLatest(selectedColor, updateSelectableColors); }
public SelectProjectViewModel( ITogglDataSource dataSource, IRxActionFactory rxActionFactory, IInteractorFactory interactorFactory, INavigationService navigationService, IDialogService dialogService, ISchedulerProvider schedulerProvider, IStopwatchProvider stopwatchProvider) { Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(dialogService, nameof(dialogService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); Ensure.Argument.IsNotNull(stopwatchProvider, nameof(stopwatchProvider)); this.dataSource = dataSource; this.dialogService = dialogService; this.interactorFactory = interactorFactory; this.navigationService = navigationService; this.schedulerProvider = schedulerProvider; this.stopwatchProvider = stopwatchProvider; Close = rxActionFactory.FromAsync(close); ToggleTaskSuggestions = rxActionFactory.FromAction <ProjectSuggestion>(toggleTaskSuggestions); SelectProject = rxActionFactory.FromAsync <AutocompleteSuggestion>(selectProject); IsEmpty = dataSource.Projects.GetAll().Select(projects => projects.None()); PlaceholderText = IsEmpty.Select(isEmpty => isEmpty ? Resources.EnterProject : Resources.AddFilterProjects); }
public TermsOfServiceViewModel(IRxActionFactory rxActionFactory, INavigationService navigationService) : base(navigationService) { Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); ViewPrivacyPolicy = rxActionFactory.FromAsync(openPrivacyPolicy); ViewTermsOfService = rxActionFactory.FromAsync(openTermsOfService); }
public SelectDateTimeViewModel(IRxActionFactory rxActionFactory, IMvxNavigationService navigationService) { Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); this.navigationService = navigationService; SaveCommand = rxActionFactory.FromAsync(save); CloseCommand = rxActionFactory.FromAsync(close); }
public SelectCountryViewModel(INavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; this.rxActionFactory = rxActionFactory; SelectCountry = rxActionFactory.FromAsync <SelectableCountryViewModel>(selectCountry); Close = rxActionFactory.FromAsync(close); }
public OutdatedAppViewModel(IPlatformInfo platformInfo, IRxActionFactory rxActionFactory, INavigationService navigationService) : base(navigationService) { Ensure.Argument.IsNotNull(platformInfo, nameof(platformInfo)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); storeUrl = platformInfo.StoreUrl; UpdateApp = rxActionFactory.FromAsync(updateApp); OpenWebsite = rxActionFactory.FromAsync(openWebsite); }
public AboutViewModel( IRxActionFactory rxActionFactory, INavigationService navigationService) : base(navigationService) { Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); OpenLicensesView = rxActionFactory.FromAsync(openLicensesView); OpenPrivacyPolicyView = rxActionFactory.FromAsync(openPrivacyPolicyView); OpenTermsOfServiceView = rxActionFactory.FromAsync(openTermsOfServiceView); }
public AboutViewModel(IMvxNavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; this.rxActionFactory = rxActionFactory; OpenPrivacyPolicyView = rxActionFactory.FromAsync(openPrivacyPolicyView); OpenTermsOfServiceView = rxActionFactory.FromAsync(openTermsOfServiceView); OpenLicensesView = rxActionFactory.FromAsync(openLicensesView); }
public SelectDateFormatViewModel(IMvxNavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; Close = rxActionFactory.FromAsync(close); SelectDateFormat = rxActionFactory.FromAsync <SelectableDateFormatViewModel>(selectFormat); DateTimeFormats = availableDateFormats .Select(dateFormat => new SelectableDateFormatViewModel(dateFormat, false)) .ToImmutableList(); }
public SelectWorkspaceViewModel( IInteractorFactory interactorFactory, INavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.interactorFactory = interactorFactory; this.navigationService = navigationService; Close = rxActionFactory.FromAsync(close); SelectWorkspace = rxActionFactory.FromAsync <SelectableWorkspaceViewModel>(selectWorkspace); }
public SelectBeginningOfWeekViewModel(INavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; Close = rxActionFactory.FromAsync(close); SelectBeginningOfWeek = rxActionFactory.FromAsync <SelectableBeginningOfWeekViewModel>(selectFormat); BeginningOfWeekCollection = Enum.GetValues(typeof(BeginningOfWeek)) .Cast <BeginningOfWeek>() .Select(beginningOfWeek => new SelectableBeginningOfWeekViewModel(beginningOfWeek, false)) .ToArray(); }
public BrowserViewModel(IMvxNavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); Close = rxActionFactory.FromAsync(() => navigationService.Close(this)); }
public NoWorkspaceViewModel( ISyncManager syncManager, IInteractorFactory interactorFactory, INavigationService navigationService, IAccessRestrictionStorage accessRestrictionStorage, ISchedulerProvider schedulerProvider, IRxActionFactory rxActionFactory) : base(navigationService) { Ensure.Argument.IsNotNull(syncManager, nameof(syncManager)); Ensure.Argument.IsNotNull(accessRestrictionStorage, nameof(accessRestrictionStorage)); Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.syncManager = syncManager; this.accessRestrictionStorage = accessRestrictionStorage; this.interactorFactory = interactorFactory; this.rxActionFactory = rxActionFactory; CreateWorkspaceWithDefaultName = rxActionFactory.FromObservable(createWorkspaceWithDefaultName); TryAgain = rxActionFactory.FromAsync(tryAgain); IsLoading = Observable.CombineLatest( CreateWorkspaceWithDefaultName.Executing, TryAgain.Executing, CommonFunctions.Or); }
public UpcomingEventsNotificationSettingsViewModel( INavigationService navigationService, IUserPreferences userPreferences, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; this.userPreferences = userPreferences; this.rxActionFactory = rxActionFactory; var options = new[] { CalendarNotificationsOption.Disabled, CalendarNotificationsOption.WhenEventStarts, CalendarNotificationsOption.FiveMinutes, CalendarNotificationsOption.TenMinutes, CalendarNotificationsOption.FifteenMinutes, CalendarNotificationsOption.ThirtyMinutes, CalendarNotificationsOption.OneHour }; AvailableOptions = options.Select(toSelectableOption).ToList(); SelectOption = rxActionFactory.FromAction <SelectableCalendarNotificationsOptionViewModel>(onSelectOption); Close = rxActionFactory.FromAsync(close); }
public UpcomingEventsNotificationSettingsViewModel( IMvxNavigationService navigationService, IUserPreferences userPreferences, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; this.userPreferences = userPreferences; this.rxActionFactory = rxActionFactory; this.AvailableOptions = new List <CalendarNotificationsOption> { CalendarNotificationsOption.Disabled, CalendarNotificationsOption.WhenEventStarts, CalendarNotificationsOption.FiveMinutes, CalendarNotificationsOption.TenMinutes, CalendarNotificationsOption.FifteenMinutes, CalendarNotificationsOption.ThirtyMinutes, CalendarNotificationsOption.OneHour }; SelectOption = rxActionFactory.FromAction <CalendarNotificationsOption>(onSelectOption); Close = rxActionFactory.FromAsync(() => navigationService.Close(this, Unit.Default)); }
public SiriShortcutsViewModel( IInteractorFactory interactorFactory, IRxActionFactory rxActionFactory, ISchedulerProvider schedulerProvider, INavigationService navigationService) : base(navigationService) { Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); this.interactorFactory = interactorFactory; this.schedulerProvider = schedulerProvider; NavigateToCustomReportShortcut = rxActionFactory.FromAsync(navigateToCustomReportShortcut); NavigateToCustomTimeEntryShortcut = rxActionFactory.FromAsync(navigateToCustomTimeEntryShortcut); }
public ReportsCalendarViewModel( ITimeService timeService, ITogglDataSource dataSource, IRxActionFactory rxActionFactory, INavigationService navigationService, ISchedulerProvider schedulerProvider) : base(navigationService) { Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(timeService, nameof(timeService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); this.dataSource = dataSource; this.timeService = timeService; this.schedulerProvider = schedulerProvider; SelectDay = rxActionFactory.FromAsync <ReportsCalendarDayViewModel>(calendarDayTapped); SelectShortcut = rxActionFactory.FromAction <ReportsCalendarBaseQuickSelectShortcut>(quickSelect); CurrentPageObservable = currentPageSubject .AsObservable() .DistinctUntilChanged(); SelectedDateRangeObservable = selectedDateRangeSubject .ShareReplay(1); HighlightedDateRangeObservable = highlightedDateRangeSubject .ShareReplay(1); }
public ReportsCalendarViewModel( ITimeService timeService, IDialogService dialogService, ITogglDataSource dataSource, IIntentDonationService intentDonationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(timeService, nameof(timeService)); Ensure.Argument.IsNotNull(dialogService, nameof(dialogService)); Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(intentDonationService, nameof(intentDonationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.timeService = timeService; this.dialogService = dialogService; this.dataSource = dataSource; this.intentDonationService = intentDonationService; SelectDay = rxActionFactory.FromAsync <ReportsCalendarDayViewModel>(calendarDayTapped); SelectShortcut = rxActionFactory.FromAction <ReportsCalendarBaseQuickSelectShortcut>(quickSelect); CurrentPageObservable = currentPageSubject.AsObservable(); SelectedDateRangeObservable = selectedDateRangeSubject .ShareReplay(1); HighlightedDateRangeObservable = highlightedDateRangeSubject .ShareReplay(1); }
public NotificationSettingsViewModel( INavigationService navigationService, IBackgroundService backgroundService, IPermissionsChecker permissionsChecker, IUserPreferences userPreferences, ISchedulerProvider schedulerProvider, IRxActionFactory rxActionFactory) : base(navigationService) { Ensure.Argument.IsNotNull(backgroundService, nameof(backgroundService)); Ensure.Argument.IsNotNull(permissionsChecker, nameof(permissionsChecker)); Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); PermissionGranted = backgroundService.AppResumedFromBackground .SelectUnit() .StartWith(Unit.Default) .SelectMany(_ => permissionsChecker.NotificationPermissionGranted) .DistinctUntilChanged() .AsDriver(schedulerProvider); UpcomingEvents = userPreferences.CalendarNotificationsSettings() .Select(s => s.Title()) .DistinctUntilChanged() .AsDriver(schedulerProvider); RequestAccess = rxActionFactory.FromAction(requestAccess); OpenUpcomingEvents = rxActionFactory.FromAsync(openUpcomingEvents); }
public SiriShortcutsSelectReportPeriodViewModel( ITogglDataSource dataSource, IInteractorFactory interactorFactory, IRxActionFactory rxActionFactory, ISchedulerProvider schedulerProvider, INavigationService navigationService) : base(navigationService) { Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); this.interactorFactory = interactorFactory; PickWorkspace = rxActionFactory.FromAsync(pickWorkspace); var reportPeriods = Enum.GetValues(typeof(ReportPeriod)) .Cast <ReportPeriod>() .Where(p => p != ReportPeriod.Unknown) .ToImmutableList(); ReportPeriods = SelectReportPeriod .Select(selectedPeriod => reportPeriods.Select(p => new SelectableReportPeriodViewModel(p, p == selectedPeriod)).ToImmutableList()) .AsDriver(ImmutableList <SelectableReportPeriodViewModel> .Empty, schedulerProvider); WorkspaceName = SelectedWorkspace .Where(ws => ws != null) .Select(workspace => workspace.Name) .AsDriver(schedulerProvider); }
public ReportsCalendarViewModel( ITimeService timeService, IDialogService dialogService, ITogglDataSource dataSource, IIntentDonationService intentDonationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(timeService, nameof(timeService)); Ensure.Argument.IsNotNull(dialogService, nameof(dialogService)); Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(intentDonationService, nameof(intentDonationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.timeService = timeService; this.dialogService = dialogService; this.dataSource = dataSource; this.intentDonationService = intentDonationService; SelectDay = rxActionFactory.FromAsync <ReportsCalendarDayViewModel>(calendarDayTapped); SelectShortcut = rxActionFactory.FromAction <ReportsCalendarBaseQuickSelectShortcut>(quickSelect); CurrentPageObservable = currentPageSubject .StartWith(MonthsToShow - 1) .DistinctUntilChanged(); }
public RatingViewModel( ITimeService timeService, IRatingService ratingService, IAnalyticsService analyticsService, IOnboardingStorage onboardingStorage, INavigationService navigationService, ISchedulerProvider schedulerProvider, IRxActionFactory rxActionFactory) : base(navigationService) { Ensure.Argument.IsNotNull(timeService, nameof(timeService)); Ensure.Argument.IsNotNull(ratingService, nameof(ratingService)); Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService)); Ensure.Argument.IsNotNull(onboardingStorage, nameof(onboardingStorage)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.timeService = timeService; this.ratingService = ratingService; this.analyticsService = analyticsService; this.onboardingStorage = onboardingStorage; this.schedulerProvider = schedulerProvider; Impression = impressionSubject.AsDriver(this.schedulerProvider); IsFeedbackSuccessViewShowing = isFeedbackSuccessViewShowing.AsDriver(this.schedulerProvider); HideRatingView = hideRatingView.AsDriver(this.schedulerProvider); PerformMainAction = rxActionFactory.FromAsync(performMainAction); }
public TokenResetViewModel( IUserAccessManager userAccessManager, ITogglDataSource dataSource, IDialogService dialogService, IMvxNavigationService navigationService, IUserPreferences userPreferences, IAnalyticsService analyticsService, ISchedulerProvider schedulerProvider, IRxActionFactory rxActionFactory, IInteractorFactory interactorFactory ) { Ensure.Argument.IsNotNull(dataSource, nameof(dataSource)); Ensure.Argument.IsNotNull(userAccessManager, nameof(userAccessManager)); Ensure.Argument.IsNotNull(dialogService, nameof(dialogService)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences)); Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); this.dataSource = dataSource; this.userAccessManager = userAccessManager; this.dialogService = dialogService; this.navigationService = navigationService; this.userPreferences = userPreferences; this.analyticsService = analyticsService; this.schedulerProvider = schedulerProvider; this.rxActionFactory = rxActionFactory; this.interactorFactory = interactorFactory; Email = emailSubject .DistinctUntilChanged() .AsDriver(schedulerProvider); IsPasswordMasked = isPasswordMaskedSubject .DistinctUntilChanged() .AsDriver(schedulerProvider); TogglePasswordVisibility = rxActionFactory.FromAction(togglePasswordVisibility); Done = rxActionFactory.FromObservable(done); SignOut = rxActionFactory.FromAsync(signout); Error = Done.Errors .Select(transformException); HasError = Error .Select(error => !string.IsNullOrEmpty(error)) .DistinctUntilChanged() .AsDriver(schedulerProvider); NextIsEnabled = Password .Select(Multivac.Password.From) .CombineLatest(Done.Executing, (password, isExecuting) => password.IsValid && !isExecuting) .DistinctUntilChanged() .AsDriver(schedulerProvider); }
public SelectDurationFormatViewModel( IMvxNavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; Close = rxActionFactory.FromAsync(close); SelectDurationFormat = rxActionFactory.FromAsync <SelectableDurationFormatViewModel>(selectFormat); DurationFormats = Enum.GetValues(typeof(DurationFormat)) .Cast <DurationFormat>() .Select(durationFormat => new SelectableDurationFormatViewModel(durationFormat, false)) .ToImmutableList(); }
public SelectClientViewModel( IInteractorFactory interactorFactory, IMvxNavigationService navigationService, ISchedulerProvider schedulerProvider, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(schedulerProvider, nameof(schedulerProvider)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.interactorFactory = interactorFactory; this.navigationService = navigationService; this.rxActionFactory = rxActionFactory; Close = rxActionFactory.FromAsync(close); SelectClient = rxActionFactory.FromAsync<SelectableClientBaseViewModel>(selectClient); }
public CalendarPermissionDeniedViewModel(IPermissionsService permissionsService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(permissionsService, nameof(permissionsService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.permissionsService = permissionsService; EnableAccess = rxActionFactory.FromAction(enableAccess); Close = rxActionFactory.FromAsync(() => NavigationService.Close(this, Unit.Default)); }
public CalendarPermissionDeniedViewModel(IMvxNavigationService navigationService, IPermissionsService permissionsService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(permissionsService, nameof(permissionsService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.navigationService = navigationService; this.permissionsService = permissionsService; EnableAccess = rxActionFactory.FromAction(enableAccess); Close = rxActionFactory.FromAsync(close); }
public override Task Initialize() { var enabledObservable = ForceItemSelection ? SelectCalendar.Elements .Select(_ => SelectedCalendarIds.Any()) .DistinctUntilChanged() : Observable.Return(true); Done = rxActionFactory.FromAsync(done, enabledObservable); return(base.Initialize()); }
protected SelectUserCalendarsViewModelBase( IUserPreferences userPreferences, IInteractorFactory interactorFactory, INavigationService navigationService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences)); Ensure.Argument.IsNotNull(interactorFactory, nameof(interactorFactory)); Ensure.Argument.IsNotNull(navigationService, nameof(navigationService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); UserPreferences = userPreferences; NavigationService = navigationService; this.interactorFactory = interactorFactory; this.rxActionFactory = rxActionFactory; SelectCalendar = rxActionFactory.FromAction <SelectableUserCalendarViewModel>(toggleCalendarSelection); Close = rxActionFactory.FromAsync(OnClose); Done = rxActionFactory.FromAsync(OnDone, doneEnabledSubject.AsObservable()); Calendars = calendarsSubject.AsObservable().DistinctUntilChanged(); }
public TermsOfServiceViewModel(IBrowserService browserService, IRxActionFactory rxActionFactory) { Ensure.Argument.IsNotNull(browserService, nameof(browserService)); Ensure.Argument.IsNotNull(rxActionFactory, nameof(rxActionFactory)); this.browserService = browserService; this.rxActionFactory = rxActionFactory; ViewPrivacyPolicy = rxActionFactory.FromAction(() => openUrl(privacyPolicyUrl)); ViewTermsOfService = rxActionFactory.FromAction(() => openUrl(termsOfServiceUrl)); Close = rxActionFactory.FromAsync <bool>(result => NavigationService.Close(this, result)); }