0

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

4

1 回答 1

0

AdjustedLabel="{Binding ElementName=MyLabel}"会做你正在寻找的东西。

考虑阅读一些文档以开始使用 WPF、绑定、依赖属性和 XAML 语法。您可以从XAML Syntax In DetailDependency Properties OverviewData Binding Overview开始。

于 2010-07-01T21:11:33.860 回答