Declined
Last Updated: 19 Jul 2022 08:02 by ADMIN
Nicholas
Created on: 18 Jul 2022 19:57
Category: UI for Blazor
Type: Feature Request
0
Change ThemeColor to unified ENum

Current implementation of Theme Color is annoying.

  1. Setting the ThemeColor to be a static class instead of an ENum is bizarre.  It makes it really annoying to pass a typed themeColor into an input parameter.  I can understand the want to be more flexible and the inputs to your controls being a string
  2. You are re-using the ThemeColor in several different places where it is simply repeated. This makes things really annoying.  

 

I recommend:

  1. Keeping the inputs to your controls for theme colors to be a string, so you can maintain the flexiblity (reason I assume you changed this in the first place)
  2. Use a single enum and in the documentation / examples say by default use "nameof(ThemeColor.Primary) for default themes"  You can add your own custom theme by .... and pass in a string.

 

 

 

1 comment
ADMIN
Dimo
Posted on: 19 Jul 2022 08:02

Hi Nicholas,

I agree that the current implementation may appear strange at first glance. However, I confirm that this is intentional. The components have different collections of valid ThemeColors, although this may not be evident.

As you mentioned, the string type allows custom values, especially with custom compiled themes.

If the current implementation does not suit your scenario, you can create a custom reusable collection of the ThemeColors that you use.

On a side note, here is a related feature about a global ThemeColor that we will consider for a future version.

Regards,
Dimo
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.