by Administrator
26. July 2009 04:35
The following XAML code:
<CheckBox Name="MyCheckBox" FontWeight="Bold" Margin="0,6,4,0" VerticalAlignment="Top">
Print To File:
</CheckBox>
<TextBox Width="200" VerticalAlignment="Top" Text="c:\MyFile.prn">
<TextBox.IsEnabled>
<Binding ElementName="MyCheckBox" Path="IsChecked" />
</TextBox.IsEnabled>
</TextBox>
is the equivalent of:
Bindind binding = new Binding("IsChecked");
binding.ElementName = "MyCheckBox";
tb.SetBinding(TextBox.IsEnabledProperty, binding);
b22586b3-f7d6-46ab-ad03-fe10e186f0a7|0|.0
Tags: xaml
CodeNote