I want to loop through the controls on a UserControl and set a property if the control isn’t bound.
e.g, If I have these controls:
<Button x:Name="uxButton" Content="Foo"/>
<Button x:Name="uxButton2" Content="{Binding Foo}"/>
<TextBlock x:Name="uxText" Text="Blah"></TextBlock>
<TextBlock x:Name="uxText2" Text="{Binding Blah}"></TextBlock>
I would want to set the Content property on uxButton but not on uxButton2.
I would want to set the Text property on uxText but not on uxText2
I’m using Silverlight 2.0 (but if this were easier in 3.0 I’d like to hear).
How do I know that uxButton2 and uxText2 are bound?
Unfortunately the answer seems to be no. 🙁
In WPF there is a GetBindingExpression method. No such feature in Silverlight: http://silverlight.net/forums/t/47216.aspx
Although this IS present in Silverlight 3 : GetBindingExpression