Issue with binding Collection type of dependency property in style

Posted by user344101 on Stack Overflow See other posts from Stack Overflow or by user344101
Published on 2010-05-18T14:18:48Z Indexed on 2010/05/18 14:20 UTC
Read the original article Hit count: 215

Filed under:
|
|

Hi, I have a customcontrol exposing a Dependency property of type ObservableCollection. When i bind this properrty directly as part ofthe control's mark up in hte containing control everythihng works fine

/< temp:EnhancedTextBox CollectionProperty="{Binding Path=MyCollection, Mode=TwoWay}"/>

But when i try to do the binding in the style created for the control it fails,

/< Style x:Key="abc2" TargetType="{x:Type temp:EnhancedTextBox}" >

<Setter Property="CollectionProperty" Value="{Binding Path=MyCollection, Mode=TwoWay}"/>

Please help !!!!!

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf