Comments (4)
The ThemeManager in ControlzEx only provides the theming infrastructure and does not provide any built in theme or resources.
Note that by default no theming is applied to any controls. Clicking Light/Dark buttons, which call ChangeTheme have no effect.
That's because ControlzEx does not provide any colors/resources/templates/styles.
If I have to specify the colours in various controls styles, how should I reference them? I have tried things such as MahApps.Colors.Highlight and ThemeGenerator.Colors.Highlight but neither works.
You have to either use MahApps.Metro to get some styles/colors to influence or you have to build all that stuff on your own.
The only colors/resources provided by the runtime theme generator are the ones from
and those only get supplied if the theme is really runtime generated.Runtime generation of themes only happens if you have registered a
LibraryThemeProvider
.
To get an idea of what you'll have to do you can have a look at the following files/places:
https://github.com/ControlzEx/ControlzEx/blob/develop/src/ControlzEx.Showcase/Theming/ShowcaseLibraryThemeProvider.cs
https://github.com/ControlzEx/ControlzEx/blob/develop/src/ControlzEx.Showcase/Themes/Themes/GeneratorParameters.json
https://github.com/ControlzEx/ControlzEx/blob/develop/src/ControlzEx.Showcase/Themes/Themes/Theme.Template.xaml
I hope this helps.
from controlzex.
The easiest way to register your themes with the provider is to do it the way it's done by MahApps.Metro, Fluent.Ribbon or the showcase application here.
Assuming you want to use the template approach (Theme.Template.xaml + GeneratorParameters.json):
- Define your
LibraryThemeProvider
(call the base ctor withtrue
) - In your
Generic.xaml
use<theming:MyLibraryThemeProvider x:Key="{x:Static theming:ShowcaseLibraryThemeProvider.DefaultInstance}" />
Assuming you want to do everything manually:
- Use the above to ease registration
- Add code to your app startup or in the ctor of your
LibraryThemeProvider
- Register your themes with your
LibraryThemeProvider
- Add resources to your
LibraryTheme
instances by callingAddResource
on them
from controlzex.
Thanks Batzen. I suspected something like that was the case, but couldn't quite pull across all the documentation to make sense of it.
If I wanted to use pre-defined resource dictionaries for my themes, how would I do that?
The documentation only goes as far as to say:
You may also provide a custom ResourceDictionary with all the needed resources.
Get yourself a copy of the required Template
MahApps.Metro: https://github.com/MahApps/MahApps.Metro/blob/main/src/MahApps.Metro/Styles/Themes/Theme.Template.xaml
Fluent.Ribbon: https://github.com/fluentribbon/Fluent.Ribbon/blob/master/Fluent.Ribbon/Themes/Themes/Theme.Template.xaml
Replace all items surrounded by double curly braces {{ Content to Replace }}
Remember to create all needed variants. E.g.: If you want to support light and dark themes you will need to implement both.
Once I have my template(s), how do I import those into ThemeManager so they can be used?
from controlzex.
Thanks for the help @batzen, appreciate it. I'll give that ago.
from controlzex.
Related Issues (20)
- TabControlEx - Selected Item is recreated when I switch tab HOT 1
- WindowChromeWindow - space around window except top HOT 10
- Window Button Style HOT 5
- GlowBorder disapears on WindowChromeWindow if ResizeMode = NoResize HOT 12
- Topmost not always working with WindowChromeWindow HOT 3
- Window Border Issue on Windows 7/8 (only in alpha version)
- Window dims when not active HOT 2
- Dark theme for system menu for WindowChromeBehavior HOT 2
- TabControlEx: TabStripPlacement issues HOT 3
- ControlzEx.WindowChromeWindow lacks documentation HOT 1
- Initial Window CornerPreference HOT 4
- WindowChromeWindow expands when docked to the top of the screen HOT 2
- How can I remove the border around a single border window? HOT 15
- NullReferenceException if Window closed in Window_Loaded HOT 1
- System.MissingFieldException: 'Field not found: 'ControlzEx.Behaviors.WindowChromeBehavior.TryToBeFlickerFreeProperty'.' HOT 9
- Proposal to update ThemeManager.md with path requirements for theme resource files HOT 3
- controlzex is missing NuGet package README file
- The content of `WindowChromeWindow` will miss one pixel on the top side if `GlowColor` is used HOT 4
- Frequent crash in WindowChromeBehavior -> GetHitTestResult HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controlzex.