/* ----------------------------------------------------------------- */ /// /// MainViewModel /// /// <summary> /// Initializes a new instance of the MainViewModel class /// with the specified settings. /// </summary> /// /* ----------------------------------------------------------------- */ public MainViewModel(SettingFolder src, SynchronizationContext context) : base(new Aggregator(), context) { var recent = Environment.SpecialFolder.Recent.GetName(); var mon = new DirectoryMonitor(recent, "*.pdf.lnk", src.IO, GetDispatcher(false)); var password = new Query <string>(e => Send(new PasswordViewModel(e, src.IO, context))); Model = new MainFacade(src, password, context); Ribbon = new RibbonViewModel(Model.Bindable, Aggregator, context); Recent = new RecentViewModel(mon, Aggregator, context); SetCommands(); Track(() => Model.Setup(App.Arguments)); }
/* ----------------------------------------------------------------- */ /// /// MainViewModel /// /// <summary> /// Initializes a new instance of the MainViewModel class /// with the specified settings. /// </summary> /// /* ----------------------------------------------------------------- */ public MainViewModel(SettingsFolder src) : base(new Messenger()) { var recent = Environment.SpecialFolder.Recent.GetName(); var mon = new DirectoryMonitor(recent, "*.pdf.lnk", src.IO); var password = new Query <string>(e => Send(new PasswordViewModel(e, src.IO, Context))); Model = new MainFacade(src, password, Context); Ribbon = new RibbonViewModel(Model.Bindable, MessengerInstance); Recent = new RecentViewModel(mon, MessengerInstance); Data.Source.PropertyChanged += (s, e) => Ribbon.Raise(); Data.Busy.PropertyChanged += (s, e) => Ribbon.Raise(); SetCommands(); Post(() => Model.Setup(App.Arguments)); }