views:

17

answers:

1

I'm hoping this will be my last question today. I'm in a hurry and google is not helping much (that or I'm searching the wrong places).

I created some custom properties and behaviors so my RadioButtons can alter my labels Content and the mask of my TextBoxes.

I could pass a String as a property, but how do I pass another control as a property? (AdjustedLabel is of type Label)

    <RadioButton i:CPF_CNPJAdjustBehavior.LabelContent="Apple" i:CPF_CNPJAdjustBehavior.AdjustedLabel="??????????" Content="CPF" Height="16" HorizontalAlignment="Left" Margin="30,216,0,0" Name="radioButton1" VerticalAlignment="Top" GroupName="a" IsChecked="True">         
        <int:Interaction.Behaviors>
            <i:CPF_CNPJAdjustBehavior/>
        </int:Interaction.Behaviors>
    </RadioButton>
    <Label Content="Label" Height="28" HorizontalAlignment="Left" Margin="20,81,0,0" Name="MyLabel" VerticalAlignment="Top" />

What do I have do write in "?????????" to set AdjustedLabel to the label named "MyLabel" ?

Thanks in Advance

Clark

A: 

AdjustedLabel="{Binding ElementName=MyLabel}" will do what you're searching for.

Consider reading some documentation for getting started with WPF, Bindings, Dependency Properties and XAML syntax. You could start with XAML Syntax In Detail, Dependency Properties Overview and Data Binding Overview.

Julien Lebosquain
Thanks! It's so simple i'm quite embarassed. Worked like a charm
Conrad Clark