Can I see the bounding box around WPF controls at runtime ?
-
I'm trying to figure out some alignment issues in one of my form. Grid, containing stackpanels, containing grids. ... It's an ItemTemplate, so I cannot see the design in Visual Studio, so I have to run and adjust the XAML and run again (some changes can be tested live, I know). So, is there a way to see the bounded box around controls ? I bodge something by wrapping controls inside Border and put a thickness of 1 for debugging. But there must be a better way. Thanks.
CI/CD = Continuous Impediment/Continuous Despair
-
I'm trying to figure out some alignment issues in one of my form. Grid, containing stackpanels, containing grids. ... It's an ItemTemplate, so I cannot see the design in Visual Studio, so I have to run and adjust the XAML and run again (some changes can be tested live, I know). So, is there a way to see the bounded box around controls ? I bodge something by wrapping controls inside Border and put a thickness of 1 for debugging. But there must be a better way. Thanks.
CI/CD = Continuous Impediment/Continuous Despair
You should be able to use the "live visual tree" and "live property explorer" tools, which are built in to Visual Studio: Inspect XAML properties while debugging - Visual Studio (Windows) | Microsoft Learn[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer