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

Visual state change

1 Answer 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vit100
Top achievements
Rank 1
Vit100 asked on 19 Oct 2010, 08:31 PM
Is it possible to change property  of a component in some visual state without having full ControlTemplate in resource?
I need to change visual state property of Text (make it green in Valid state )for a MaskedTextBox.
So I believe I need to edit Template and do my stuff. But it means I need to have full ControlTemplate in resource.
How to achive this with minimum code in XAML file?
May be you can template this property in component itself (similar to ControlOuterBorder_Focused or ControlForeground_Disabled), so I will be able to apply style without modifing whole control template?  Something like ControlValidForeground??

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 22 Oct 2010, 05:20 PM
Hello Vit100,

There are couple of ways to achieve this. You can either handle the ValueChanged event and set the Foreground proeprty of the RadMaskedTextbox to Green. You can also use a style and bind the foreground property of the control to its Value property with a IValueConverter which will return a different brush depending on the value and how it changes.

All the best,
Alex Fidanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Vit100
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or