Stopbyte

How to browse WPF Control Style contents at Runtime without debugging?

I encountered a Bug in my WPF XAML Styles, no errors are reported at Build time. but when running the App, i get the wrong Effects and Look (i believe the wrong style is loaded or some inheritance issue). Though at Design time the Control looks good and the appropriate Style is loaded.

So to solve this is there any Plugin or something i can do to sneak into the WPF Style loaded at Runtime?

thanks

2 Likes

Try out WPF Inspector. it’s a good tool for such a task.

Though i personally prefer using Visual Studio itself. Whether your app is running in Debug mode or not. (or even if it’s not your own app) you still can debug it with Visual Studio (preferably 2015+ versions). It really has a good UI Controls Tree View, but i am not sure you can view styles inner content always, but you can view all controls using Visual Studio including the window’s own title bar content.

2 Likes

I would suggest that if you are just tending to access the style property to check which style is loaded you can easily do that through:

var MyLoadedStyle = MyControl.Style;

Otherwise if you are looking for a far more advanced snicking into XAML and Style i would suggest using Snoop it’s a good open source tool that allows you to browse into your WPF applications visual tree without the need to any debugger at runtime.

1 Like

I really liked both solutions @Sine @KunniCan, but had to pick one.

Visual Studio TreeView Debugger looks really fine to use.