Hi Sergey Arutchev,
I'm attaching the example solution. It has 3 projects:
OfficeBlue, CustomTheme and OfficeBlue_CustomDisabledState
is our theme that has all the xaml. You may need it to add or modify other controls but it's not actually used or referenced anywhere.
is the custom theme project. It has a Generic.xaml resource dictionary that merges the xaml that will be included in the theme. Also in the custom theme there are copies from OfficeBlue for the Calendar.xaml
. These three are added to the Generic.xaml as merged dictionaries. The themes in these 3 files are modified. You can search for the word "" in them to see what's the difference.
is a project that has example with the 3 controls and a checkbox that enable/disable them. In it's App.xaml.cs
it creates a Theme based on the Generic from the CustomTheme project and uses it as ApplicationTheme
. These line does the work:
// Set your custom theme as application theme prior to initializing any controls...
Note that OfficeBlue_CustomDisabledState
has reference to the CustomTheme
project. Also they have reference to the dlls for Telerik.Windows.Controls
If you add more controls to your project you will need to include the corresponding dlls.
In the example project the disabled state is removed from the VisualStateManagers
. The controls use x:Name="DisabledVisual"
element that is placed on top of the control and is somewhat transparent. If you want to make the controls shallow but keep the text black you may need to placed several DisabledVisuals over the buttons and backgrounds but behind the TextBlocks
. if you are new to styling and templating in xaml you will need additional help.
One of the benefits of having custom theme is that it won't include all the xaml files from Office_Blue so it's download size will get smaller. Right now it has only 3 Controls from input so you will need to add the xaml from the default Office_Blue theme for the controls you will use in your application.
the Telerik team