I'm a newbie with WPF and I copied some code into my Resource Dictionary so that all standard TextBoxes and Buttons would get the radcontrols styles. I found it in another thread.
Now, I found that I can customize the error template using the following code.
How do I combine the two TextBox styles so that I can keep the Error Template at a common level (Control), and use it for all controls. Can I change the Error template style to be based on the Telerik ThemeResourceKey for Control? then base all other controls on it instead?
<
Style
TargetType
=
"Button"
BasedOn
=
"{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Windows7Theme, ElementType=Button}}"
/>
<
Style
TargetType
=
"ListBox"
BasedOn
=
"{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Windows7Theme, ElementType=ListBox}}"
/>
<
Style
TargetType
=
"TextBox"
BasedOn
=
"{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Windows7Theme, ElementType=TextBox}}"
/>
<
Style
TargetType
=
"CheckBox"
BasedOn
=
"{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Windows7Theme, ElementType=CheckBox}}"
/>
<
Style
TargetType
=
"Control"
x:Key
=
"ValidationErrorTemplate"
>
<
Style.Triggers
>
<
Trigger
Property
=
"Validation.HasError"
Value
=
"True"
>
<
Setter
Property
=
"ToolTip"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
Path=(Validation.Errors)[0].ErrorContent}" />
</
Trigger
>
</
Style.Triggers
>
</
Style
>
<
Style
TargetType
=
"TextBox"
BasedOn={StaticResource ValidationErrorTemplate}" />
How do I combine the two TextBox styles so that I can keep the Error Template at a common level (Control), and use it for all controls. Can I change the Error template style to be based on the Telerik ThemeResourceKey for Control? then base all other controls on it instead?