locked
Blend 4: Silverlight control with property validation RRS feed

Answers

  • No, this is "by design" :). Blend's property inspector support coercion - so we are actually displaying the value of the actual instance, instead of what is in the XAML.

    A good example of this is the ProgressBar control. Let's assume that the max and min values of this control are from 1 to 10. Then if the user enters 0 for the Value, that will be persisted in XAML, but the property grid will display 1 because the value gets clamped at the min value.

    Thanks,
    Unni


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Ralf Dobslaw Tuesday, July 27, 2010 8:15 AM
    Monday, July 19, 2010 10:37 PM

All replies

  • No, this is "by design" :). Blend's property inspector support coercion - so we are actually displaying the value of the actual instance, instead of what is in the XAML.

    A good example of this is the ProgressBar control. Let's assume that the max and min values of this control are from 1 to 10. Then if the user enters 0 for the Value, that will be persisted in XAML, but the property grid will display 1 because the value gets clamped at the min value.

    Thanks,
    Unni


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Ralf Dobslaw Tuesday, July 27, 2010 8:15 AM
    Monday, July 19, 2010 10:37 PM
  • Thank you for that response. I really like this forum because of the quality of the responses!

    Is it planned to change this behavior? "Normal users" don't work inside XAML.

    Let's suppose to have the following:
    A control has a MIN and a MAX property. We have a validation inside code that MIN is not allowed to be greater than MAX.
    The default values are: MIN = 0 and MAX = 10. The user changes MIN to 11. Blend shows 10. The user changes later MAX to 15. MIN changes to 11 (after reloading the page).

    Our customers call this behavior unpredictable. They control power plants (or similar plants) with our Silverlight controls and it is not possible to explain this behavior to them. 

    To be hornest ... for me it looks like a critical bug to store other data than is shown to XAML (not like WYSIWYG).

    Tuesday, July 20, 2010 7:49 AM