Skip to content

Remove invalid Fluent DataGridColumn styles#9757

Merged
dipeshmsft merged 5 commits intodotnet:mainfrom
MitchRazga:disable-invalid-fluent-styles
Oct 10, 2024
Merged

Remove invalid Fluent DataGridColumn styles#9757
dipeshmsft merged 5 commits intodotnet:mainfrom
MitchRazga:disable-invalid-fluent-styles

Conversation

@MitchRazga
Copy link
Copy Markdown
Contributor

@MitchRazga MitchRazga commented Sep 10, 2024

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

	<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 MitchRazga requested review from a team as code owners September 10, 2024 14:33
@MitchRazga MitchRazga changed the title Update DataGrid.xaml Disable invalid Fluent DataGridColumn styles Sep 10, 2024
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Sep 10, 2024
dipeshmsft
dipeshmsft previously approved these changes Oct 4, 2024
@MitchRazga
Copy link
Copy Markdown
Contributor Author

MitchRazga commented Oct 4, 2024

@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

@MitchRazga MitchRazga changed the title Disable invalid Fluent DataGridColumn styles Remove invalid Fluent DataGridColumn styles Oct 5, 2024
@dipeshmsft dipeshmsft merged commit 3c5b1c7 into dotnet:main Oct 10, 2024
@dipeshmsft
Copy link
Copy Markdown
Member

Thanks @MitchRazga for bringing up this issue and for the fix.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fluent Themes contain invalid DataGridColumn styles

3 participants