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

[Spec] Themes Implementation in Winforms #5166

Open
davidbuckleyni opened this issue Jun 28, 2021 · 0 comments
Open

[Spec] Themes Implementation in Winforms #5166

davidbuckleyni opened this issue Jun 28, 2021 · 0 comments

Comments

@davidbuckleyni
Copy link

@davidbuckleyni davidbuckleyni commented Jun 28, 2021

Please bring the ability of themes to winforms every other platform has it but WinForms.

We should be able to set the theme on startup and change it on the fly with a listener.

Should be something like this

services.configure(themeName);

This would then look in resources.resx for dark or light theme pallets. That could be used to style the entire application for example

DarkControlColor

There should also be some way of getting the value from here as some sort of enumeration query able. And be able to retrive the system colours once selected. Making it that the above is not necessary with the resources.

For example an eternal enum that would pick up any custom themes the user has created.

public enum AppThemeEnum
{
   Unspecified,
   Light,
   Dark,
   UserTheme
}

Detect & Change User Interface Style
DeviceInfo

API DESCRIPTION
AppTheme CurrentAppTheme What is the actual theme
AppTheme.ApplyTheme This can be called from the this.ApplyTheme maybe they don't want all forms to be theme.

The theme should also allow us to implement rounded corner where we could set a radius of the corner in what ever dpi the user wanted. Be it inches pixels cm mm.

Already
While this is implemented for xamrain it would give a clear conception of what is expected for the winforms flavour.

xamarin/Essentials#927

VisualElement
AppThemeChanged Event

API DESCRIPTION
void AppThemeChanged(AppThemeChangedEventArgs args) Event that is fired whenever the app theme changed
public class AppThemeChangedEventArgs : EventArgs
{
  public AppTheme RequestedTheme { get; }
}

To Apply the theme on a form one could or one could have a class derived from form for example

 public class Form1 : ThemeForm
 {

  }

Resources could be based off Colours per app theme

Theme.AppTheme =AppThemeEnum.Dark

Availability
This should go into .net core,5 and 6.

image

@davidbuckleyni davidbuckleyni changed the title Themes Implementation in Winforms [Spec] Themes Implementation in Winforms Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant