Exemple #1
0
        /* ----------------------------------------------------------------- */
        ///
        /// 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.GetFolderPath(Environment.SpecialFolder.Recent);
            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));
        }
Exemple #2
0
 /* ----------------------------------------------------------------- */
 ///
 /// HeroViewModel
 ///
 /// <summary>
 /// Initializes a new instance of the RecentViewModel with the
 /// specified argumetns.
 /// </summary>
 ///
 /// <param name="items">Recently used PDF files.</param>
 /// <param name="messenger">Messenger object.</param>
 ///
 /* ----------------------------------------------------------------- */
 public RecentViewModel(DirectoryMonitor items, IMessenger messenger) : base(messenger)
 {
     Items        = items;
     Menu.Command = new RelayCommand(() => Post(() => Process.Start(Items.Directory)));
 }