private void OnWorkspaceActivated(object sender, ItemEventArgs <Workspace> e) { Workspace activeWorkspace = _desktopWindow.ActiveWorkspace; if (activeWorkspace == null) { this.ImageViewer = null; } else { IImageViewer imageViewer = ImageViewerComponent.GetAsImageViewer(activeWorkspace); this.ImageViewer = imageViewer; } }
/// <summary> /// Initializes a new instance of <see cref="ImageViewerToolComponent"/>. /// </summary> protected ImageViewerToolComponent(IDesktopWindow desktopWindow) { Platform.CheckForNullReference(desktopWindow, "desktopWindow"); _desktopWindow = desktopWindow; ImageViewer = ImageViewerComponent.GetAsImageViewer(_desktopWindow.ActiveWorkspace); }