views:

299

answers:

1

Hello: I'm pretty mightily surprised and sheepishly stumped:

Have a new UserControl backed by UserControl01.cs that is exposing two properties. One is a plain old CLR property, the other the newer DP property format. eg:

string PropertyOne {get;set;}
and the second property is a public DP (construct is too long to list here).

From the XAML side, I wish to expose these value. How?

On both properties (old CLR as well as second DP wrapper format) I've tried syntax like:

 <TextBlock Text={Binding Prop1}/>
 <TextBlock Text={Binding Source=., Path=Prop1}/>

I've tried putting a ref to the class type in the Resource dictionary and referencing it with

 <TextBlock Text={Binding Source={StaticReference myType}, Path=Prop1}/>

but that obviously ends up being a stack overflow as the dictionary instantiates a second copy of the Control...

I read a post somewhere that in WPF one can x:Name the control itself, and then

  <TextBlock Text="{Binding {ElementName=theName, Path=Prop1}"/>

but we don't have ElementName binding in Ag...so that's not the way...

a) How to bind to a the UserControl's Property? Any property!

b) If not (!!!!???!!!!) -- and can only bind to DTO's or other BO's...what's the guiding logic/explanation as to how we should design UserControls that want to expose their values?

A: 

Silverlight 3 has control to control binding. http://silverlight.net/learn/learnvideo.aspx?video=187309