public SettingsPageViewModel(PageManager pageManager, IReactiveFolderSettings settings) : base(pageManager) { Settings = settings; ReactionCheckInterval = new ReactiveProperty<string>(settings.DefaultMonitorIntervalSeconds.ToString()); ReactionCheckInterval.Subscribe(x => { settings.DefaultMonitorIntervalSeconds = int.Parse(x); settings.Save(); }); ReactionCheckInterval.SetValidateNotifyError(x => { int temp; if (false == int.TryParse(x, out temp)) { return "Number Only"; } return null; }); }
public FolderReactionManagePageViewModel(PageManager pageManager, IFolderReactionMonitorModel monitor, IEventAggregator ea, IAppPolicyManager appPolicyManager, IHistoryManager historyManager, IReactiveFolderSettings settings) : base(pageManager) { Monitor = monitor; _EventAggregator = ea; AppPolicyManager = appPolicyManager; HistoryManager = historyManager; Settings = settings; CurrentFolder = new ReactiveProperty<ReactionManageFolderViewModel>(); FolderStack = new ObservableCollection<ReactionManageFolderViewModel>(); FolderStack.CollectionChangedAsObservable() .Subscribe(x => { CurrentFolder.Value = FolderStack.Last(); }); FolderStack.Add(new ReactionManageFolderViewModel(this, Monitor.RootFolder)); }