Esempio n. 1
0
        public PopupViewModel(WallpaperOrchestrator wallpaperOrchestrator)
        {
            _wallpaperOrchestrator = wallpaperOrchestrator;

            _wallpaperOrchestrator.WallpaperChanged += (s, e) =>
            {
                OnPropertyChanged(nameof(Past));
                OnPropertyChanged(nameof(Current));
                OnPropertyChanged(nameof(Future));
            };

            ForwardCommand  = new AsyncRelayCommand(OnForward, x => _wallpaperOrchestrator.Playlist.Any());
            BackwardCommand = new AsyncRelayCommand(OnBackward, x => _wallpaperOrchestrator.PlaylistLast.Any());
        }
Esempio n. 2
0
        public TaskBarIconViewModel(IDependencyResolver resolver,
                                    IUiApplication uiApplication,
                                    IDispatcher dispatcher,
                                    IEnvironmentParameters environmentParameters,
                                    WallpaperClientVersionService wallpaperClientVersionService)
        {
            _regKeyAutostart = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
            _orchestrator    = new WallpaperOrchestrator(resolver);
            _state           = new NoConnection(_orchestrator, this);

            _uiApplication                 = uiApplication;
            _environmentParameters         = environmentParameters;
            _wallpaperClientVersionService = wallpaperClientVersionService;
            ExitCommand            = new RelayCommand(x => OnExit());
            LoginCommand           = new AsyncRelayCommand(() => _state.OnLogin());
            ChangeAutostartCommand = new RelayCommand(x => OnChangeAutostart());
            ResetViewCommand       = new RelayCommand(x => OnResetView());
            ExecuteUpdateCommand   = new AsyncRelayCommand(() => OnExecuteUpdateCommand(), x => _updateHandle != null && _updateHandle.HasNewVersion);

            dispatcher.Dispatch(() =>
            {
                _state.OnLogin();
            });
        }
Esempio n. 3
0
 public NoConnection(WallpaperOrchestrator orchestrator, TaskBarIconViewModel parent)
     : base(orchestrator, parent)
 {
     _popupViewModel = new NotConnectedPopupViewModel();
 }
Esempio n. 4
0
 public Connected(WallpaperOrchestrator orchestrator, TaskBarIconViewModel parent)
     : base(orchestrator, parent)
 {
     _popupViewModel = new PopupViewModel(orchestrator);
 }
Esempio n. 5
0
 public ApplicationState(WallpaperOrchestrator orchestrator, TaskBarIconViewModel parent)
 {
     _orchestrator = orchestrator;
     _parent       = parent;
 }