In my VSPackage I have an event handler for the WindowActivated event on the EnvDTE.WindowEvents interface.
In my code I check whether the activated window is WinForms designer with (in VB.NET)
If TypeOf GotFocus.Object Is IDesignerHost Then
...
End if
or an ASP designer window with
If TypeOf GotFocus.Object Is EnvDTE.HTMLWindow Then
...
End if
What is the best way to detect when a XAML designer window is activated?
Of course, I can check the file extension in the caption (GotFocus.Caption), but I wondered if there was a better way.