コード例 #1
0
 public AppSettingsFlyout(
     IAppSettingsViewModel viewModel
     )
 {
     ViewModel = viewModel ?? throw new ArgumentNullException(nameof(viewModel));
     InitializeComponent();
 }
コード例 #2
0
ファイル: RootViewModel.cs プロジェクト: sfuqua/PassKeep
        /// <summary>
        /// Constructs the RootViewModel with the specified parameters.
        /// </summary>
        /// <param name="activationMode">How the app was launched.</param>
        /// <param name="openedFile">The file the app was opened to (or null).</param>
        /// <param name="passwordGenViewModel">The ViewModel for the password generation flyout.</param>
        /// <param name="helpViewModel">The ViewModel for the help flyout.</param>
        /// <param name="appSettingsViewModel">The ViewModel for the settings flyout.</param>
        /// <param name="clipboardViewModel">a ViewModel over a clipboard clear timer.</param>
        /// <param name="taskNotificationService">A service used to control the UI for blocking operations.</param>
        /// <param name="clipboardService">A service for accessing the clipboard.</param>
        /// <param name="settingsService">A service for accessing app settings.</param>
        /// <param name="idleTimer">A timer used for computing idle timer.</param>
        public RootViewModel(
            ActivationMode activationMode,
            ITestableFile openedFile,
            IPasswordGenViewModel passwordGenViewModel,
            IHelpViewModel helpViewModel,
            IAppSettingsViewModel appSettingsViewModel,
            IClipboardClearTimerViewModel clipboardViewModel,
            ITaskNotificationService taskNotificationService,
            ISensitiveClipboardService clipboardService,
            IAppSettingsService settingsService
            )
        {
            ActivationMode = activationMode;
            CandidateFile  = openedFile;

            PasswordGenViewModel = passwordGenViewModel ?? throw new ArgumentNullException(nameof(passwordGenViewModel));
            HelpViewModel        = helpViewModel ?? throw new ArgumentNullException(nameof(helpViewModel));
            AppSettingsViewModel = appSettingsViewModel ?? throw new ArgumentNullException(nameof(appSettingsViewModel));

            TaskNotificationService = taskNotificationService ?? throw new ArgumentNullException(nameof(taskNotificationService));

            ClipboardClearViewModel = clipboardViewModel ?? throw new ArgumentNullException(nameof(clipboardViewModel));
            this.clipboardService   = clipboardService ?? throw new ArgumentNullException(nameof(clipboardService));

            this.settingsService = settingsService;
        }
コード例 #3
0
        public SettingsViewModel(INavigationService navigationService, IAppSettingsViewModel appSettings, IProjectSettingsViewModel projectSettings, IAppSettingsService appSettingsService, IProjectSettingsService projectSettingsService)
        {
            _appSettingsService     = appSettingsService;
            _projectSettingsService = projectSettingsService;
            AppSettings             = appSettings;
            ProjectSettings         = projectSettings;

            SaveCommand = new RelayCommand(p => ExecuteSave());
            BackCommand = new RelayCommand(p => navigationService.NavigateBack());
        }