private static TaskPopup InitTaskPopup(TaskCollection taskCollection) { var taskPopup = new TaskPopup { DataContext = taskCollection.Select((t) => new TaskViewModel(t)) }; taskPopup.Hidden += (sender, e) => taskCollection.RemoveFinishedTasks(); return taskPopup; }
public void Initialize(IPluginContext pluginContext) { this.logo = new NoCapLogo(); this.taskbarIcon = InitTaskbarIcon(BuildContextMenu(pluginContext)); this.commandRunner = InitCommandRunner(pluginContext.CommandRunner); this.taskCollection = InitTaskCollection(pluginContext.CommandRunner); this.taskPopup = InitTaskPopup(this.taskCollection); this.taskbarIcon.ShowCustomBalloon(this.taskPopup, PopupAnimation.None, null); Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; InitCommandBindings(); UpdateIcon(1); }