Remove invalid Fluent DataGridColumn styles
Fixes #9755
Description
Removes invalid Fluent DataGridColumn styles
Customer Impact
Would be good to fix this before .NET 9 releases so that existing codebases can have a smoother transition to new Windows 11 themes
Regression
No
Testing
- Used reproduction from #9755 to reference all resource dictionaries like in Fluent.xaml
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
...
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/ComboBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/ContextMenu.xaml" />
<ResourceDictionary Source="pack://application:,,,/TestResources;component/DataGrid.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/DatePicker.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Fluent;component/Styles/Expander.xaml" />
...
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
- Created a local copy of DataGrid.xaml which I made the changes to
- Referenced the local DataGrid.xaml in MergedDictionaries instead of the one in PresentationFramework
- Ran the application a few times Now able to iterate through theme resources without any exceptions
Risk
Minimal
Does not look like these styles are referenced anywhere else.
Likely just something that was missed when the resource dictionaries were ported from WPF UI.
Documentation confirms in multiple places that only FrameworkElement or derived types can have styles for example
Microsoft Reviewers: Open in CodeFlow
@MitchRazga please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
@dotnet-policy-service agree [company="{your company}"]Options:
- (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
- (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"Contributor License Agreement
@dotnet-policy-service agree
Thanks @MitchRazga for bringing up this issue and for the fix.