Inheritance: NotificationObject
Example #1
0
        public SettingsViewModel(CandySettings settings)
        {
            _settings = settings;
            _phantom = _settings.Clone();

            ApplicationInformationServiceUrl = _phantom.ToReactivePropertyAsSynchronized(x => x.ApplicationInformationServiceUrl)
                                                       .SetValidateAttribute(() => ApplicationInformationServiceUrl);
            ApplicationRootDirectoryPath = _phantom.ToReactivePropertyAsSynchronized(x => x.ApplicationRootDirectoryPath);

            SetDefaultServiceCommand = ApplicationInformationServiceUrl.DistinctUntilChanged()
                                                                       .Select(x => x != CandySettings.DefaultApplicationInformationServiceUrl)
                                                                       .ToReactiveCommand();
            SetDefaultServiceCommand.Subscribe(_ => SetDefaultService());

            OkCommand = new ReactiveCommand();
            OkCommand.Subscribe(_ => ApplySettings());

            CancelCommand = new ReactiveCommand();
            CancelCommand.Subscribe(_ => Cancel());
        }
Example #2
0
 /// <summary>
 /// 使用する <see cref="IStateRepository"/> を指定して、<see cref="ApplicationManager"/> クラスの新しいインスタンスを初期化します。
 /// </summary>
 /// <param name="repository">使用する <see cref="IStateRepository"/> 。</param>
 public ApplicationManager(IStateRepository repository)
 {
     _repository = repository;
     Settings    = new CandySettings();
 }
Example #3
0
 public void ApplySettings(CandySettings newSettings)
 {
     Mapper.Map(newSettings, this);
 }
Example #4
0
 /// <summary>
 /// 使用する <see cref="IStateRepository"/> を指定して、<see cref="ApplicationManager"/> クラスの新しいインスタンスを初期化します。
 /// </summary>
 /// <param name="repository">使用する <see cref="IStateRepository"/> 。</param>
 public ApplicationManager(IStateRepository repository)
 {
     _repository = repository;
     Settings = new CandySettings();
 }
Example #5
0
 public void ApplySettings(CandySettings newSettings)
 {
     Mapper.Map(newSettings, this);
 }