private static void thumbnail_TabbedThumbnailActivated(object sender, TabbedThumbnailEventArgs e) { Frame content = e.WindowsControl as Frame; if (content != null) { //var currentIndex = LayoutPane.Children.IndexOf(); int currentIndex; LayoutDocumentPaneGroup paneGroup = (LayoutDocumentPaneGroup)((LayoutPanel)dockManager.Layout.Children.ElementAt(0)).Children[0]; foreach (LayoutDocumentPane a in paneGroup.Children) { var layDoc = a.Children.Where(x => x.Content == content).SingleOrDefault(); if (layDoc != null) { currentIndex = a.Children.IndexOf(layDoc); a.SelectedContentIndex = currentIndex; dockManager.ActiveContent = content; if (ParentWindow.WindowState == WindowState.Minimized) { ParentWindow.WindowState = WindowState.Maximized; } if (!ParentWindow.IsActive) { ParentWindow.Activate(); } break; } } } }
/// <summary> /// Handler method that's called when the user clicks the close button in an Aero Peek preview thumbnail. Finds the window associated with the thumbnail /// and calls <see cref="Form.Close" /> on it. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void preview_TabbedThumbnailClosed(object sender, TabbedThumbnailEventArgs e) { foreach (TitleBarTab tab in Tabs.Where(tab => tab.Content.Handle == e.WindowHandle)) { CloseTab(tab); break; } }
private void Thumbnail_Activated(object sender, TabbedThumbnailEventArgs e) { // i can't track down why exactly, but this is being fired twice. if (_thumbActivated) { _thumbActivated = false; } else { _thumbActivated = true; OpenEmail(); } }
/// <summary> /// Handler method that's called when the user clicks the close button in an Aero Peek preview thumbnail. Finds the window associated with the thumbnail /// and calls <see cref="Form.Close" /> on it. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void preview_TabbedThumbnailClosed(object sender, TabbedThumbnailEventArgs e) { foreach (TitleBarTab tab in Tabs.Where(tab => tab.Content.Handle == e.WindowHandle)) { tab.Content.Close(); if (e.TabbedThumbnail != null) { TaskbarManager.Instance.TabbedThumbnail.RemoveThumbnailPreview(e.TabbedThumbnail); } break; } }
private void Preview_TabbedThumbnailActivated(object sender, TabbedThumbnailEventArgs e) { if (e.WindowsControl is TabItem tabItem) { tabControl1.SelectedItem = tabItem; } if (WindowState == WindowState.Minimized) { WindowState = WindowState.Normal; } Activate(); }
void preview_TabbedThumbnailMaximized(object sender, TabbedThumbnailEventArgs e) { // User clicked on the maximize button on the thumbnail's context menu // Maximize the app this.WindowState = FormWindowState.Maximized; // If there is a selected tab, take it's screenshot // invalidate the tab's thumbnail // update the "preview" object with the new thumbnail if (tabControl1.Size != Size.Empty && tabControl1.TabPages.Count > 0 && tabControl1.SelectedTab != null) { UpdatePreviewBitmap(tabControl1.SelectedTab); } }
//The following method is part of the lab. When a thumbnail is requested, provide it on demand //by loading an image from a resource. private void TabbedThumbnail_TabbedThumbnailBitmapRequested(object sender, TabbedThumbnailEventArgs e) { //if (_sneakySource == null) //{ // _sneakySource = new BitmapImage(); // _sneakySource.BeginInit(); // _sneakySource.DecodePixelHeight = 200; // _sneakySource.UriSource = new Uri("pack://application:,,,/assets/SpeedyGonzales.jpg"); // _sneakySource.EndInit(); ////} Bitmap preview = new Bitmap(nowPlayingFile.GetImageFile(MJImageFileFlags.IMAGEFILE_THUMBNAIL_MEDIUM)); e.TabbedThumbnail.SetImage(preview); e.TabbedThumbnail.DisplayFrameAroundBitmap = false; }
private void Preview_TabbedThumbnailClosed(object sender, TabbedThumbnailEventArgs e) { if (e.WindowsControl is TabItem tabItem) { _closingFromThumbnail = true; ((tabItem.Content as ContentControl).Content as WorkspaceViewModel).Close.Execute(false); _closingFromThumbnail = false; var preview = sender as TabbedThumbnail; preview.TabbedThumbnailMinimized -= Preview_TabbedThumbnailMinimized; preview.TabbedThumbnailMaximized -= Preview_TabbedThumbnailMaximized; preview.TabbedThumbnailActivated -= Preview_TabbedThumbnailActivated; preview.TabbedThumbnailClosed -= Preview_TabbedThumbnailClosed; preview.TabbedThumbnailBitmapRequested -= Preview_TabbedThumbnailBitmapRequested; } }
void preview_TabbedThumbnailActivated(object sender, TabbedThumbnailEventArgs e) { // User selected a tab via the thumbnail preview // Select the corresponding control in our app foreach (TabPage page in tabControl1.TabPages) { if (page.Handle == e.WindowHandle) { // Select the tab in the application UI as well as taskbar tabbed thumbnail list tabControl1.SelectedTab = page; TaskbarManager.Instance.TabbedThumbnail.SetActiveTab(page); } } // Also activate our parent form (incase we are minimized, this will restore it) if (this.WindowState == FormWindowState.Minimized) { this.WindowState = FormWindowState.Normal; } }
/// <summary> /// Handler method that's called when the user clicks on an Aero Peek preview thumbnail. Finds the tab associated with the thumbnail and /// focuses on it. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void preview_TabbedThumbnailActivated(object sender, TabbedThumbnailEventArgs e) { foreach (TitleBarTab tab in Tabs.Where(tab => tab.Content.Handle == e.WindowHandle)) { SelectedTabIndex = Tabs.IndexOf(tab); TaskbarManager.Instance.TabbedThumbnail.SetActiveTab(tab.Content); break; } // Restore the window if it was minimized if (WindowState == FormWindowState.Minimized) { User32.ShowWindow(Handle, 3); } else { Focus(); } }
private void Thumbnail_Activated(object sender, TabbedThumbnailEventArgs e) { // i can't track down why exactly, but this is being fired twice. if (_thumbActivated) { _thumbActivated = false; } else { _thumbActivated = true; if (ConnectionStatus == NotifierStatus.AuthenticationFailed) { Program.MainForm.Jumplist_ShowPreferences(new string[] { "account", this.Account.FullAddress }); } else { if (ConnectionStatus != NotifierStatus.Offline) { OpenEmail(); } } } }
void preview_TabbedThumbnailMinimized(object sender, TabbedThumbnailEventArgs e) { // User clicked on the minimize button on the thumbnail's context menu // Minimize the app this.WindowState = FormWindowState.Minimized; }
private void Preview_TabbedThumbnailMinimized(object sender, TabbedThumbnailEventArgs e) { WindowState = WindowState.Minimized; }
private void Preview_TabbedThumbnailMaximized(object sender, TabbedThumbnailEventArgs e) { WindowState = WindowState.Maximized; UpdateCurrentPreview(); }
private static void thumbnail_TabbedThumbnailMaximized(object sender, TabbedThumbnailEventArgs e) { ParentWindow.WindowState = WindowState.Maximized; thumbnail_TabbedThumbnailActivated(sender, e); }
private static void thumbnail_TabbedThumbnailMinimized(object sender, TabbedThumbnailEventArgs e) { ParentWindow.WindowState = WindowState.Minimized; }
private void _Preview_TabbedThumbnailClosed(object sender, TabbedThumbnailEventArgs e) { (Control.FromHandle(e.WindowHandle) as Form).Close(); }