PropertyStatus

PropertyStatus

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


ajj3085 posted on Wednesday, October 22, 2008

I'm looking at PropertyStatus, trying to figure out it's use.  At first I thought it'd wrap the entire form or user control, but it looks like it may be geared toward a single property of the BO.

One thing I noticed though... there's some code in the property setter for the control's Source property.  I thought I read in WPF Unleased it's not safe to do that, because WPF will call SetValue directly, thus bypassing the setter.  Is that code that should only be run if the property is set directly?  If you do set the property in code, will SetSource be called twice; once by the property setting, and once via the registered DependencyPropertyChangedCallback?  Just want to make sure I'm using the control properly.

sergeyb replied on Wednesday, October 22, 2008

You are correct, you should have one Property Status per field/property in your UI/business object.  There is code in Dependency property declaration that would still run all needed operations even if SetValue is called, so you are safe on the second question.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: ajj3085 [mailto:cslanet@lhotka.net]
Sent: Wednesday, October 22, 2008 9:41 AM
To: Sergey Barskiy
Subject: [CSLA .NET] PropertyStatus

 

I'm looking at PropertyStatus, trying to figure out it's use.  At first I thought it'd wrap the entire form or user control, but it looks like it may be geared toward a single property of the BO.

One thing I noticed though... there's some code in the property setter for the control's Source property.  I thought I read in WPF Unleased it's not safe to do that, because WPF will call SetValue directly, thus bypassing the setter.  Is that code that should only be run if the property is set directly?  Just want to make sure I'm using the control properly


Copyright (c) Marimer LLC