That's right.  For performance, the framework will go straight to the
backing store, bypassing your property.

 

As a general rule of thumb, only your own code that uses the property
will go through the property (though you can go straight to the backing
store yourself if you want).

 

To ensure code gets run, I normally use the OnPropertyChanged override.
This always fires after the property has changed, even if the backing
store approach was used.

 

Carl.

 

Carl Scarlett

Senior .NET/WPF Developer, UX Designer - Genesis Team

IT Applications Delivery | Bankwest

A: Level 5, 199 Hay Street | Perth | Western Australia | 6004

P: (08) 9449 8703

M: 0408 913 870

E: [email protected]

 

 

 

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Stephen Price <[email protected]>
Sent: Monday, 6 September 2010 10:31 AM
To: ozWPF <[email protected]>
Subject: Dependency properties

 

hey all, 

Someone on the team suggested some changes to a property that I had 
due to something to do with the WPF binding engine not using the 
property to get the underlaying values. This threw me and I've not had 
a chance to research/proof this but thought I'd throw it out here for 
comment. 

public string Filter 
{ 
get 
{ 
if(somecondition) return somethingElse; 
return (string)GetValue(FilterProperty); 
} 
set 
{ 
SetValue(FilterProperty, value); 
} 
} 

so I have a filter property with some logic in it, but apparently if I 
bind to this the wpf binding goes straight to the FilterProperty 
instead of my Filter property. I'll research this when I have a spare 
min unless someone can debunk it. :) 

have a great day! 
Stephen 
_______________________________________________ 
ozwpf mailing list 
[email protected] 
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf 

______________________________________________________________________ 
This email has been scanned by the MessageLabs Email Security System. 
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________ 

________________________________________________________________________
_______ 

This email has been scanned by the Bankwest Email Security System. 
________________________________________________________________________
_______ 

_______________________________________________________________________________
Unencrypted electronic mail is not secure and may not be authentic.
If you have any doubts as to the contents please telephone to confirm.

This electronic transmission including any attachments is intended only
for those to whom it is addressed. It may contain copyright material or
information that is confidential, privileged or exempt from disclosure by law.
Any claim to privilege is not waived or lost by reason of mistaken transmission
of this information. If you are not the intended recipient you must not
distribute or copy this transmission and should please notify the sender.
Your costs for doing this will be reimbursed by the sender.

We do not accept liability in connection with computer virus, data corruption,
delay, interruption, unauthorised access or unauthorised amendment.
_______________________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to