예제 #1
0
        public AboutWindow(IAboutViewModel viewModel)
            : base(viewModel)
        {
            InitializeComponent();

            // TODO: Better way to let the ViewModel know about the error container?
            viewModel.ErrorContainer = errorContainer;
        }
        public AboutDialog(ITelemetryAccess telemetryAccess,
                           IAboutViewModel viewModel)
        {
            telemetryAccess.TrackPageView(nameof(AboutDialog));

            DataContext = viewModel;
            viewModel.CloseRequested += (sender, args) => Close();

            InitializeComponent();
        }
예제 #3
0
 public SettingsViewModel(IAboutViewModel aboutViewModel,
                          ISettingsBackgroundJobViewModel settingsBackgroundJobViewModel,
                          IRegionalSettingsViewModel regionalSettingsViewModel,
                          ISettingsPersonalizationViewModel settingsPersonalizationViewModel)
 {
     AboutViewModel            = aboutViewModel;
     BackgroundJobViewModel    = settingsBackgroundJobViewModel;
     RegionalSettingsViewModel = regionalSettingsViewModel;
     PersonalizationViewModel  = settingsPersonalizationViewModel;
 }
예제 #4
0
        public SettingsViewModel(INavigationService navigationService,
                                 IAboutViewModel aboutViewModel,
                                 ISettingsBackgroundJobViewModel settingsBackgroundJobViewModel,
                                 ISettingsPersonalizationViewModel settingsPersonalizationViewModel)
        {
            this.navigationService = navigationService;

            AboutViewModel           = aboutViewModel;
            BackgroundJobViewModel   = settingsBackgroundJobViewModel;
            PersonalizationViewModel = settingsPersonalizationViewModel;
        }
예제 #5
0
        public AboutView()
        {
            InitializeComponent();

            // Get a reference to our view model, which has been set in XAML
            ViewModel = this.DataContext as IAboutViewModel;
            if (ViewModel == null)
            {
                throw new NullReferenceException();
            }
        }
예제 #6
0
        public SettingsViewModel(IMvxNavigationService navigationService,
                                 IAboutViewModel aboutViewModel,
                                 ISettingsBackgroundJobViewModel settingsBackgroundJobViewModel,
                                 ISettingsPersonalizationViewModel settingsPersonalizationViewModel,
                                 ISettingsSecurityViewModel settingsSecurityViewModel,
                                 IMvxLogProvider logProvider) : base(logProvider, navigationService)
        {
            this.navigationService = navigationService;

            AboutViewModel            = aboutViewModel;
            BackgroundJobViewModel    = settingsBackgroundJobViewModel;
            PersonalizationViewModel  = settingsPersonalizationViewModel;
            SettingsSecurityViewModel = settingsSecurityViewModel;
        }
예제 #7
0
 private WindowController Create(IConvenientWindowManager windowManager               = null,
                                 IEventAggregator eventAggregator                     = null,
                                 IAboutViewModel aboutViewModel                       = null,
                                 IMainWindowViewModel mainWindowViewModel             = null,
                                 IAttemptsPerWeekViewModel attemptsPerWeekViewModel   = null,
                                 IAttemptsViewModel attemptsViewModel                 = null,
                                 ICompletedLengthsViewModel completedLengthsViewModel = null,
                                 IKataCompletedViewModel kataCompletedViewModel       = null,
                                 IReminderSettingsViewModel reminderSettingsViewModel = null,
                                 IFeedbackViewModel feedbackViewModel                 = null)
 {
     return(new WindowController(
                windowManager ?? Substitute.For <IConvenientWindowManager>(),
                eventAggregator ?? Substitute.For <IEventAggregator>(),
                mainWindowViewModel ?? Substitute.For <IMainWindowViewModel>(),
                aboutViewModel ?? Substitute.For <IAboutViewModel>(),
                attemptsPerWeekViewModel ?? Substitute.For <IAttemptsPerWeekViewModel>(),
                attemptsViewModel ?? Substitute.For <IAttemptsViewModel>(),
                completedLengthsViewModel ?? Substitute.For <ICompletedLengthsViewModel>(),
                kataCompletedViewModel ?? Substitute.For <IKataCompletedViewModel>(),
                reminderSettingsViewModel ?? Substitute.For <IReminderSettingsViewModel>(),
                feedbackViewModel ?? Substitute.For <IFeedbackViewModel>()
                ));
 }
예제 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsViewModel"/> class.
        /// </summary>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        /// <param name="updateService">
        /// The update Service.
        /// </param>
        /// <param name="aboutViewModel">
        /// The about View Model.
        /// </param>
        /// <param name="errorService">
        /// The error Service.
        /// </param>
        public OptionsViewModel(IUserSettingService userSettingService, IUpdateService updateService, IAboutViewModel aboutViewModel, IErrorService errorService)
        {
            this.Title = "Options";
            this.userSettingService = userSettingService;
            this.updateService      = updateService;
            this.errorService       = errorService;
            this.AboutViewModel     = aboutViewModel;
            this.OnLoad();

            this.SelectedTab   = OptionsTab.General;
            this.UpdateMessage = "Click 'Check for Updates' to check for new versions";
        }
예제 #9
0
 public AboutDialog(IAboutViewModel vm, CushWindow owningWindow, DialogSettings settings)
     : base(owningWindow, settings)
 {
     DataContext = vm;
     InitializeComponent();
 }
예제 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsViewModel"/> class.
        /// </summary>
        /// <param name="userSettingService">
        /// The user Setting Service.
        /// </param>
        /// <param name="updateService">
        /// The update Service.
        /// </param>
        /// <param name="aboutViewModel">
        /// The about View Model.
        /// </param>
        public OptionsViewModel(IUserSettingService userSettingService, IUpdateService updateService, IAboutViewModel aboutViewModel)
        {
            this.Title = "Options";
            this.userSettingService = userSettingService;
            this.updateService = updateService;
            this.AboutViewModel = aboutViewModel;
            this.OnLoad();

            this.SelectedTab = OptionsTab.General;
            this.UpdateMessage = "Click 'Check for Updates' to check for new versions";
        }
예제 #11
0
 /// <summary>
 /// Initialises a new instance of the <see cref="ShellViewModel"/> class.
 /// </summary>
 /// <param name="loginService">
 /// The login service.
 /// </param>
 /// <param name="aboutViewModel">
 /// The about View Model.
 /// </param>
 public ShellViewModel(ILoginService loginService, IAboutViewModel aboutViewModel)
 {
     this.loginService   = loginService;
     this.aboutViewModel = aboutViewModel;
 }
예제 #12
0
        public WindowController(IConvenientWindowManager windowManager,
                                IEventAggregator eventAggregator,
                                IMainWindowViewModel mainWindowViewModel,
                                IAboutViewModel aboutViewModel,
                                IAttemptsPerWeekViewModel attemptsPerWeekViewModel,
                                IAttemptsViewModel attemptsViewModel,
                                ICompletedLengthsViewModel completedLengthsViewModel,
                                IKataCompletedViewModel kataCompletedViewModel,
                                IReminderSettingsViewModel reminderSettingsViewModel,
                                IFeedbackViewModel feedbackViewModel)
        {
            if (windowManager == null)
            {
                throw new ArgumentNullException(nameof(windowManager));
            }
            if (eventAggregator == null)
            {
                throw new ArgumentNullException(nameof(eventAggregator));
            }
            if (mainWindowViewModel == null)
            {
                throw new ArgumentNullException(nameof(mainWindowViewModel));
            }
            if (aboutViewModel == null)
            {
                throw new ArgumentNullException(nameof(aboutViewModel));
            }
            if (attemptsPerWeekViewModel == null)
            {
                throw new ArgumentNullException(nameof(attemptsPerWeekViewModel));
            }
            if (attemptsViewModel == null)
            {
                throw new ArgumentNullException(nameof(attemptsViewModel));
            }
            if (completedLengthsViewModel == null)
            {
                throw new ArgumentNullException(nameof(completedLengthsViewModel));
            }
            if (kataCompletedViewModel == null)
            {
                throw new ArgumentNullException(nameof(kataCompletedViewModel));
            }
            if (reminderSettingsViewModel == null)
            {
                throw new ArgumentNullException(nameof(reminderSettingsViewModel));
            }
            if (feedbackViewModel == null)
            {
                throw new ArgumentNullException(nameof(feedbackViewModel));
            }
            _windowManager             = windowManager;
            _eventAggregator           = eventAggregator;
            _mainWindowViewModel       = mainWindowViewModel;
            _aboutViewModel            = aboutViewModel;
            _attemptsPerWeekViewModel  = attemptsPerWeekViewModel;
            _attemptsViewModel         = attemptsViewModel;
            _completedLengthsViewModel = completedLengthsViewModel;
            _kataCompletedViewModel    = kataCompletedViewModel;
            _reminderSettingsViewModel = reminderSettingsViewModel;
            _feedbackViewModel         = feedbackViewModel;

            _eventAggregator.Subscribe(this);
        }