Visual state change

2 posts, 0 answers
  1. Vit100
    Vit100 avatar
    66 posts
    Member since:
    Oct 2012

    Posted 19 Oct 2010 Link to this post

    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??
  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    637 posts

    Posted 22 Oct 2010 Link to this post

    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
Back to Top