/// <summary> /// Creates a new ShellViewModel /// </summary> /// <param name="main">Main view model</param> /// <param name="manager">Window manager</param> /// <param name="task">Mangas task</param> /// <param name="tray">Tray icon</param> public ShellViewModel(MainViewModel main, IWindowManager manager, MangasTask task, TrayIcon tray) { main_ = main; manager_ = manager; open_ = false; task_ = task; tray_ = tray; task_.MangaUpdated += TaskMangaUpdated; tray_.ItemClicked += IconItemClicked; tray_.DoubleClicked += IconDoubleClicked; tray_.NotificationClicked += IconNotificationClicked; tray_.AddItem(kShow); tray_.AddSeparator(); tray_.AddItem(kStart); tray_.AddItem(kStop); tray_.AddSeparator(); tray_.AddItem(kExit); tray_.Show(); task_.Start(); }
public ShellViewModel(MainViewModel main, IWindowManager manager, TrayIcon tray) { main_ = main; manager_ = manager; open_ = false; tray_ = tray; tray_.ItemClicked += IconItemClicked; tray_.DoubleClicked += IconDoubleClicked; tray_.NotificationClicked += IconNotificationClicked; tray_.AddItem(kShow); tray_.AddSeparator(); tray_.AddItem(kExit); tray_.Show(); }
/// <summary> /// Shows the main view /// </summary> private void Show() { if (!main_open_) { main_open_ = true; var manager = new WindowManager(); var main = new MainViewModel(configuration_, locale_); manager.ShowDialog(main); main_open_ = false; } }