From 63fc5c347f685a52ec1b3fbc7cb36c9228c8ee1e Mon Sep 17 00:00:00 2001 From: reduckted Date: Thu, 16 Feb 2023 22:07:43 +1000 Subject: [PATCH] Added an example of using the tool window's GetWindowFrame() method. --- demo/VSSDK.TestExtension/ToolWindows/RunnerWindow.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/demo/VSSDK.TestExtension/ToolWindows/RunnerWindow.cs b/demo/VSSDK.TestExtension/ToolWindows/RunnerWindow.cs index 8bcd501..13348a6 100644 --- a/demo/VSSDK.TestExtension/ToolWindows/RunnerWindow.cs +++ b/demo/VSSDK.TestExtension/ToolWindows/RunnerWindow.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel.Design; +using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; @@ -30,6 +31,13 @@ public Pane() { BitmapImageMoniker = KnownMonikers.StatusInformation; ToolBar = new CommandID(PackageGuids.TestExtension, PackageIds.RunnerWindowToolbar); + WindowFrameAvailable += (_, _) => Debug.WriteLine("RunnerWindow frame is now available"); + } + + public override void OnToolWindowCreated() + { + base.OnToolWindowCreated(); + GetWindowFrame().OnShow += (_, args) => Debug.WriteLine($"RunnerWindow state changed: {args.Reason}"); } } }