How to read a Dependency property from a method

Posted by PaN1C_Showt1Me on Stack Overflow See other posts from Stack Overflow or by PaN1C_Showt1Me
Published on 2010-04-22T13:34:16Z Indexed on 2010/04/22 14:03 UTC
Read the original article Hit count: 162

XAML:

<my:Control ItemsSource="{StaticResource MySource}"  A="true" />

Assume a Control with a dependency property A with a default value false; and a method to handle the Source Collection:

protected override void OnItemsSourceChanged(System.Collections.IEnumerable oldValue, System.Collections.IEnumerable newValue) {}

in which you want to look at A and readout its value (which is true). how would you ensure, that A is already initialized and has a given value?

Or how should this be done correctly ?

In my case A is something like AllowLateBinding ..

Could coerce callback help me?

© Stack Overflow or respective owner

Related posts about dependency-properties

Related posts about wpf