This is a migrated thread and some comments may be shown as answers.

Dynamically changing style of MS controls alongside Radcontrols

2 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 09 Nov 2018, 01:54 PM

I'm building an app where the user can switch the appearance of the UI controls a runtime.

I do this in codebehind like so:

StyleManager.ApplicationTheme = new MaterialTheme();
MaterialPalette.Palette.FontSize = 12;
MaterialPalette.Palette.MainColor = (Color)ColorConverter.ConvertFromString("#FFFC0EF1");
MaterialPalette.Palette.FontFamily = new FontFamily("Calibri");

But besides the radcontrols, there are a lot of MS controls (mostly Label), who's color, font and size i also have to switch.

And (to my surprise) there is no "RadLabel" or "RadTextBlock".

So how can I accomplish this with the regular controls? Can I make them "listen" to the StyleManager.ApplicationTheme ?

2 Answers, 1 is accepted

Sort by
0
Accepted
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
answered on 11 Nov 2018, 09:01 AM

Hello Tom,

Its better to use NoXaml binaries for implicit themes. Most of windows controls are managed by Telerik, but still if you need customization, you can add your resource and make changed. I can share a small project, where I am using 2 themes Fluent Light, dark, crystal. and its working fine.

 

Messenger App

I shared this project for another issue, but still you can get how to use dynamic themes.

0
Tom
Top achievements
Rank 1
answered on 13 Nov 2018, 03:18 PM

Thanx a million Kamran!

Your code was just what I needed to solve the problem...

Tags
General Discussions
Asked by
Tom
Top achievements
Rank 1
Answers by
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
Tom
Top achievements
Rank 1
Share this question
or