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

Fluent for WPF #17

Open
rido-min opened this issue Oct 20, 2018 · 2 comments
Open

Fluent for WPF #17

rido-min opened this issue Oct 20, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@rido-min
Copy link
Member

Do you have any plans to produce WPF Xaml styles to for WPF apps?

@kikisaints kikisaints added the enhancement New feature or request label Oct 22, 2018
@kikisaints
Copy link
Contributor

I'm not as familiar with the WPF styling/resource system as I am with UWP XAML's, and in addition this tool uses an API from the latest October 2018 Update for Windows. Not something easily translated into WPF.

That being said, I will look into what having an export for WPF feature might look like.

@thomasclaudiushuber
Copy link

thomasclaudiushuber commented Nov 3, 2018

There are some key differences in WPF.

  1. WPF doesn't have the ThemeResource Markup Extension. Means it doesn't support Dark/Light/HighContrast themes out of the box like UWP does.
  2. That said, the colors in WPF don't come from a specific Theme. Instead some ControlTemplates use parts defined in SystemColors. That class has static properties. For example SystemColors.ControlTextBrush contains the brush for control text, like a Button text. There's a corresponding SystemColors.ControlTextBrushKey property that contains the resource key to overwrite that resource. So you can overwrite it like this:

<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Red"/>

  1. Some WPF ControlTemplates reference other resources, not only those from SystemColors, and they might have also other hardcoded values. I see something like this when I create a copy of the Button Template.

  2. WPF has resources in different assemblies, and those resources are loaded depending on the Windows Theme. There's PresentationFramework.Aero.dll for Aero Theme, PresentationFramework.Classic.dll for classic theme etc. Every Windows Theme specific dll contains a generic.xaml file with all the ControlTemplates and Resources for that specific theme. But as mentioned, nothing for dark/light stuff.

That being said: I think it would be possible to generate something for WPF, but I think it would be different and a lot of work. I totally agree to what you said, @kikisaints . It's

Not something easily translated into WPF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants