However I still do not like the Gradient Background brush. It appears too light for what I want. I would like to be able to either directly set it to make it darker or simply make the theme use solid brushes in place of the gradient ones .
Is there a way to directly alter the gradient brushes -- individually - in this theme? Or is it simply constructed from the colors I specify and I have no other control over it?
7 Answers, 1 is accepted
I am posting to add that after much trial and error, I appear to have stumbled upon setting some palette colors that make my gradient stand out better. But it would still be nice to understand -- if you can find the time to explain -- what colors go into the gradient and how it is constructed.
Hello Joe,
The Windows8 and Windows8Touch palettes doesn't have gradient brushes. There could be custom brushes on your side or maybe some opacity applied to the elements can look like a gradient. If you tell me what controls do you use and send few drawings showing the gradient I can check where it comes from.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
I'm sorry to contradict you but the Windows8Touch certainly *does* have a gradient brush. In fact it has two The Resource Keys are "MainGradientBrush" and "InvertedGradientBrush" They are referred to quite often in the Windows8Touch theme XAML files. I'm just trying to understand how they are constructed
I realize that the Windows8TouchPalette doesn't have a gradient brush. But the Windows8TouchResource brushes are constructed from whatever I set in that palette and it does have the gradient brush. I'm trying to understand how the colors that I set in the palette go into the resource's gradient brushes and how I can alter things
Hello Joe,
Thank you for the clarification. The Windows8TouchResource class is a DynamicResourceExtension implementation which contains the brushes and few other properties used in the control styles. The Windows8TouchResource are updated in code when the palette changes. The MainGradientBrush, and InvertedGradientBrush are created using the following code:
LinearGradientBrush mainGradient = new LinearGradientBrush() { StartPoint = new Point(0.5, 0), EndPoint = new Point(0.5, 1) };
mainGradient.GradientStops.Add(new GradientStop() { Color = Windows8TouchPalette.Palette.EffectHighColor });
mainGradient.GradientStops.Add(new GradientStop() { Color = Windows8TouchPalette.Palette.EffectLowColor, Offset = 1 });
FreezeAndSetResource(ResourceDictionary, Windows8TouchResourceKey.MainGradientBrush, mainGradient);
LinearGradientBrush invertedGradient = new LinearGradientBrush() { StartPoint = new Point(0.5, 0), EndPoint = new Point(0.5, 1) };
invertedGradient.GradientStops.Add(new GradientStop() { Color = Windows8TouchPalette.Palette.EffectLowColor });
invertedGradient.GradientStops.Add(new GradientStop() { Color = Windows8TouchPalette.Palette.EffectHighColor, Offset = 1 });
FreezeAndSetResource(ResourceDictionary, Windows8TouchResourceKey.InvertedGradientBrush, invertedGradient);
This code executes whenever the EffectLowColor or the EffectHighColor palette properties are updated.
There is no entry point in the resources extension or the palette class that allow changing customizing the gradients. Currently, the approach that I can suggest for such modification is to extract the ControlTemplate of the control where you want to replace the gradient and use a custom brush (with StaticResource or a direct value) instead of the Windows8TouchResource extension.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hello Joe,
I am glad to hear the provided information helps.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.