Open JGT90 opened 1 year ago
This is caused by the Microsoft.VisualStudio.PlatformUI.ThemedDialogStyleLoader.UseDefaultThemedDialogStyles
attached property (which the UseVsTheme
property internally sets enables). If you don't use Themes.UseVsTheme
and instead set the UseDefaultThemedDialogStyles
directly, you'll see the same problem:
<ListView
xmlns:platform="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
platform:ThemedDialogStyleLoader.UseDefaultThemedDialogStyles="True">
</ListView>
I guess an internal Visual Studio style is removing the headers for a reason.
Unfortunately setting that attached property to false on the ListView doesn't have any effect when something above it has already enabled the default themed dialog styles (enabling the themed dialog styles causes a resource dictionary to be loaded so it applies to that element and all descendants).
I think the only option is to redefine the ControlTemplate
for the ListView
so that it has a header.
I am having the same problem. Dave, do you have an example how to redefine the ControlTemplate?
I am using a VSIX and wanted to test a GridView inside a ListView. But whenever I did it the header of the gridview was missing.
After hours of debugging I finally stumbled across the toolkit:Themes.UseVsTheme. When I removed it, everything went fine. The header was displayed again.
~toolkit:Themes.UseVsTheme="True"~