protected override IEnumerable <IResult> CanClose() { var r = HandleScriptClosing(false); foreach (var result in r) { yield return(result); } eventAggregator.Publish(new ExitingEvent()); }
public void ContentControlLoaded(object sender) { var s = sender as ContentControl; s.Focus(); RemoveAdorners(); AddNewAdorner(s, true); FirstSelected = s; NbrSelected = 1; eventAggregator.Publish(new DisplayPropertiesView1Event((s.DataContext as PluginModel).GetProperties())); }
public void CreateProfileViewModel(string filePath) { if (filePath != null && !fileSystem.Exists(filePath)) { return; } var document = scriptEditorFactory() .Configure(filePath); if (!string.IsNullOrEmpty(filePath)) { //document.LoadFileContent(fileSystem.ReadAllText(filePath)); AddRecentProfile(filePath); } eventAggregator.Publish(new ScriptDocumentAddedEvent(document)); }
public MonitorViewModel(IEventAggregator eventAggregator, IResolutionRoot resolutionRoot, FileSystem fileSystem, DisplayManager displayManager) { this.eventAggregator = eventAggregator; this.resolutionRoot = resolutionRoot; this.DisplayManager = displayManager; MonitorCollection mc = DisplayManager.Displays; Monitor = mc[0]; LayoutMonitor = new MonitorPropertyEditorViewModel(eventAggregator); this.fileSystem = fileSystem; this.eventAggregator.Publish(new MonitorViewStartedEvent(this)); eventAggregator.Publish(new DisplayPropertiesView1Event(new[] { LayoutMonitor })); this.eventAggregator.Subscribe(this); MyCockpitViewModels = new ObservableCollection <PluginModel>(); NbrSelected = 0; }