binding IsEnabled to IsValid in SL (without MVVM)

binding IsEnabled to IsValid in SL (without MVVM)

Old forum URL: forums.lhotka.net/forums/t/10857.aspx


vschaak posted on Wednesday, November 09, 2011

Hi,

I try to bind the isEnabled property of a button to the IsValid Property of a BO in a SL app, WITHOUT using MVVM. Sounds simple, at least should be.
Other controls and validation are successfully bound to textboxes, but the button is always enabled, even if validation errors occur and the object's definitly not valid.

???

What to do? (Beside using MVVM Wink)

Thanks for help.

Volker

jh72i replied on Wednesday, November 09, 2011

Perhaps the IsValid property doesn't raise a notification when it is set so the UI won't know to respond/redraw

I have a suspicion there isn't an OnPropertyChanged("IsValid") type thing going on with IsValid - its one of those more passive propeties that you interrogate rather than be notified about.

 

vschaak replied on Thursday, November 10, 2011

Hi,

indeed, IsValid/IsSavable does'nt reflect changes to the binding infrastructure Sad, at least without using own intermediate functionality (like in MVVM).

Sad.

Volker

vschaak replied on Wednesday, November 09, 2011

Hi,

false alertZip it!

There was a conflict with a base-class method, handling some controls enabled state, my fault.

IsValid definitly reacts on what it should.

 

Volker

Copyright (c) Marimer LLC