Inheritance: NotificationObject
示例#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());
        }
示例#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();
 }
示例#3
0
 public void ApplySettings(CandySettings newSettings)
 {
     Mapper.Map(newSettings, this);
 }
示例#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();
 }
示例#5
0
 public void ApplySettings(CandySettings newSettings)
 {
     Mapper.Map(newSettings, this);
 }