如何将MultiBinding的结果分配给DependencyProperty?
具体来说,我希望将“Details”DependencyProperty绑定到DetailsEditor.Text。
用户控件:
<TextBox x:Name="DetailsEditor">
<TextBox.Text>
<MultiBinding Converter="{StaticResource FilesToInstructionsConverter}" ConverterParameter=".dll|.exe|.config"
UpdateSourceTrigger="PropertyChanged" >
<Binding ElementName="UserControl" Path="SourceDirectory" UpdateSourceTrigger="PropertyChanged" />
<Binding ElementName="UserControl" Path="DestinationDirectory" UpdateSourceTrigger="PropertyChanged" />
</MultiBinding>
</TextBox.Text>
</TextBox>
UserControl的代码隐藏:
public string Details
{
get { return (string)GetValue(DetailsProperty); }
set { SetValue(DetailsProperty, value); }
}
public static readonly DependencyProperty DetailsProperty =
DependencyProperty.Register("Details", typeof(string), typeof(DirectivesControl), null);