public void UpdateState() { _windowManager.Stop(); if (ConfigManager.GetUseWallpaper()) { _windowManager.Start(WallpaperManager.GetCurrentWallpaper()); } TaskbarManager.Stop(); TaskbarManager.Start(); }
public AppShellViewModel() { var desktopManager = new DesktopManager().AddTo(this); var processManager = new WindowManager().AddTo(this); _desktopWindowManager = new DesktopWindowManager().AddTo(this); Title = new ReactiveProperty <string>("Robock"); Status = StatusTextService.Instance.ObserveProperty(w => w.Status).ToReactiveProperty(); Status.Throttle(TimeSpan.FromSeconds(30)).Subscribe(_ => StatusTextService.Instance.Status = "Ready").AddTo(this); Tabs = new ReactiveCollection <TabViewModel> { new AboutTabViewModel() }; Tabs.ToCollectionChanged().Subscribe(w => { if (!(w.Value is DesktopViewModel model) || !model.IsPrimary) { return; } VirtualScreen.SelectedIndex.Value = w.Index; model.IsSelected.Value = true; }); VirtualScreen = new VirtualScreenViewModel(); // Subscribe desktopManager.Desktops.CollectionChangedAsObservable().Subscribe(w => { if (w.Action != NotifyCollectionChangedAction.Add || !(w.NewItems[0] is Desktop desktop)) { return; } var viewModel = new DesktopViewModel(desktop, processManager, _desktopWindowManager).AddTo(this); Tabs.Insert(desktop.No - 1, viewModel); VirtualScreen.Desktops.Insert(desktop.No - 1, viewModel); }).AddTo(this); desktopManager.Initialize(); processManager.Start(); }
public static void Start() { Initalize(); WinMgr.Start(); }