예제 #1
0
        public MainWindow()
        {
            #region library buttons

            BrowseForImport  = ReactiveCommand.Create(_BrowseForImport);
            RemoveBook       = ReactiveCommand.Create(_RemoveBook, this.WhenAny(vm => vm.SelectedTableRow, (r) => r != null));
            EditMetadata     = ReactiveCommand.Create(_EditMetadata, this.WhenAny(vm => vm.SelectedTableRow, (r) => r != null));
            OpenBookFolder   = ReactiveCommand.Create(_OpenBookFolder);
            SendBook         = ReactiveCommand.Create <IList, Unit>(_SendBook, this.WhenAnyValue(vm => vm.SelectedTableRow, vm => vm.SelectedDevice, (r, d) => r != null && d != null));
            EditSettings     = ReactiveCommand.Create(_EditSettings);
            ReceiveBook      = ReactiveCommand.Create <IList, Unit>(_ReceiveBook);
            ShowAbout        = ReactiveCommand.Create(_ShowAbout);
            ToggleLeftDrawer = ReactiveCommand.Create(_ToggleLeftDrawer);

            #endregion

            #region device buttons

            SelectDevice            = ReactiveCommand.Create <string, Task <bool> >(_SelectDevice);
            EditDeviceSettings      = ReactiveCommand.Create <bool, Task <Unit> >(_EditDeviceSettings);
            OpenDeviceFolder        = ReactiveCommand.Create(_OpenDeviceFolder);
            SyncDeviceLibrary       = ReactiveCommand.Create(_SyncDeviceLibrary);
            ReorganizeDeviceLibrary = ReactiveCommand.Create(_ReorganizeDeviceLibrary);
            ScanDeviceLibrary       = ReactiveCommand.Create(_ScanDeviceLibrary);
            CloseDevice             = ReactiveCommand.Create(_CloseDevice);

            #endregion

            DevManager      = new Devices.DevManager();
            CombinedLibrary = new CombinedLibraryManager(App.LocalLibrary.Database.BOOKS);
            SnackBarQueue   = new MaterialDesignThemes.Wpf.SnackbarMessageQueue(TimeSpan.FromMilliseconds(1000));

            LeftDrawerOpen = true;
        }
예제 #2
0
        public ShellViewModel(IEventAggregator events, /*IPreferenceService configurationService,*/ IContext context,
                              TaskbarViewModel taskbarViewModel,
                              MonitorGroupSettingViewModel monitorGroupViewModel, SequenceGroupSettingViewModel sequenceGroupViewModel, WeatherSettingViewModel weatherViewModel)
        {
            this.DisplayName    = "AT Player";
            this._taskbar       = taskbarViewModel;
            this._monitorGroup  = monitorGroupViewModel;
            this._sequenceGroup = sequenceGroupViewModel;
            this._weather       = weatherViewModel;

            //this._configurationService = configurationService;
            this._context = context;

            Items.Add(_monitorGroup);
            Items.Add(_sequenceGroup);
            Items.Add(_weather);

            this.ActivateItem(_monitorGroup);

            SnackbarMessageQueue = new MaterialDesignThemes.Wpf.SnackbarMessageQueue();

            events.Subscribe(this);
        }
예제 #3
0
        /// <summary>
        /// Constructor
        /// Called when the application class is initialsied
        /// </summary>
        public application(UI.Host _host)
        {
            // Initialise the host form
            HOST = _host;

            // Initialise the user agents
            USERAGENTS = new UserAgents();

            // Initialise the referrals
            REFERRALS = new Referrals();

            // Initialse the proxies
            PROXIES = new Proxies();

            // Initialise the scraper
            SCRAPER = new Scraper();

            // Initialise the traffic class
            TRAFFIC = new Traffic();

            // Intialise the message queue
            MESSAGE_QUEUE = new MaterialDesignThemes.Wpf.SnackbarMessageQueue();
        }
예제 #4
0
 public void ShowMessage(string message, MaterialDesignThemes.Wpf.SnackbarMessageQueue messageQueue)
 {
     //the message queue can be called from any thread
     Task.Factory.StartNew(() => messageQueue.Enqueue(message));
 }