Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fluent usage documentation #10051

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dipeshmsft
Copy link
Member

@dipeshmsft dipeshmsft commented Nov 11, 2024

Microsoft Reviewers: Open in CodeFlow

@dipeshmsft dipeshmsft requested review from a team as code owners November 11, 2024 13:14
@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label Nov 11, 2024

Enabling Fluent theme in WPF application is supported at two levels : **Application** and **Window**.

There are two ways in which you can use \ enable Fluent theme in your WPF Applications - including the Fluent theme resource dictionaries or you can use the experimental **ThemeMode** APIs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be noted here that they are the same in effect, i.e. the API only includes the resource dictionary as convenience.

</Window>
```

Since, the API is experimental, for using `ThemeMode` property in code-behind, we need to suppress **WPF0001** warning first. This can be done in the application's project file as follows:
Copy link
Contributor

@miloush miloush Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to suppress the warning, what is the point of the warning if everyone suppresses it? I suggest the whole section is dropped, you can use the code-behind properties with a warning.

6. The default value of `ThemeMode` is None.
7. When **contrast themes** are enabled, HighContrast version of the Fluent theme is applied on the application. In this mode, there is no distinction between light and dark modes and all the window's will appear the same. When we switch back to normal themes, the previously set `ThemeMode` are applied on the windows.

## Using Accent color brushes in WPF applications
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be noted that this is all experimental.

@miloush
Copy link
Contributor

miloush commented Nov 11, 2024

I think it needs to be more prominently written that this is all experimental for testing purposes and might not work the same in the final release of the theming.

This specifically includes the idea of merging in a dictionary, thus all the resource keys and the way they are referenced.

Meanwhile, I would like to ask the community to go ahead and try out the new theme in their applications, and provide us with feedbacks via GitHub issues, discussions, feature suggestions and PRs to make it better.

> [!NOTE]
> While doing so, add the **"Win 11 Theming"** label to your contributions, so that it becomes easier for us to track and prioritize your issues.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

External developers can't set labels, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants