Wpf & PropertyInfo - CanWrite has changed #4836
Unanswered
ajohnstone-ks
asked this question in
Questions
Replies: 1 comment 2 replies
-
|
My recollection is that |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have a BO, and there are actions users can do that take time, so we have pushed those to an eventual consistency model. The BO when loading will check if there are any unprocessed actions and record that into the BO into a field
Locked. The BO also has a method that the UI can callRefreshLockedwhich will do a data portal call to see if the background work has finished or not. TheLockedproperty has an Async property rule which when then manually trigger when theRefreshLockedis called.We also have authorization rules on all writable properties, which at the very least check the
Lockedproperty, and deny permission for WriteProperty if Locked is true.Now for WinForms we use the Csla
ReadWriteAuthorization component and have the form listen to the BOs PropertyChanged, and ifLockedhas changed, callResetControlAuthorization` which then enables the previously disabled controls.We're now trying to do something similar in Wpf; for each control we have a Csla Wpf PropertyInfo control, and the editor control binds its IsEnabled or IsReadOnly to the CanWrite of the PropertyInfo control. This works when intially loading the page, but its not quite clear to me how to let the PropertyInfos know that the CanWrite has changed. Do we just need to raise a PropertyChanged from the BO? Have the xaml page listen for the models propertychanged of
Lockedand find all the property infos?Beta Was this translation helpful? Give feedback.
All reactions