喜欢标题。我TextBox
名为 tbFirstName ,其Text
属性与其他属性进行了多重绑定:
<local:CustomContentDialogBox.CommandParameter>
<MultiBinding Converter="{StaticResource newPerson}">
<Binding ElementName="tbID" Path="Text" Mode="OneWay"/>
<Binding ElementName="tbFirstName" Path="Text" Mode="OneWay"/>
<Binding ElementName="tbSecondName" Path="Text"/>
<Binding ElementName="cbHeight" Path="Text" />
</MultiBinding>
</local:CustomContentDialogBox.CommandParameter>
稍后在XAML中,我尝试将 tbFirstName 上的Binding
用于ICommand
,即处理方法blank = new ModelTextClear("");
<TextBox Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2"
x:Name="tbFirstName"
Text="{Binding ClearText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
它不起作用。绑定是问题的两倍吗?