WPF XAML的textbox与C#的代码绑定显示不了
<Window x:Class="WpfApplication1.Window1"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:WpfApplication1"
Title="Hello" Height="300" Width="300">
<Window.DataContext>
<vm:text2/>
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Background="GreenYellow" Name="txt1" Text="{Binding Txt ,Mode=OneWay}" MinHeight="20" MaxHeight="20" MaxWidth="100"></TextBox>
<TextBox Grid.Row="2" Background="GreenYellow" Name="txt2" Text="{Binding Txt}" MinHeight="20" MaxHeight="20" MaxWidth="100"></TextBox>
<Button Grid.Row="1" Name="btnTest" Command="{Binding Path=BtnClick}" MaxHeight="20" MaxWidth="100"></Button>
</Grid>
</Window>
private void Btn_Click(object param)
{
Window1 text = new Window1();
List<Detail> list = new List<Detail>();
Detail text111 = new Detail();
text111.Txt = "111";
list.Add(text111);
text.txt1.DataContext = list;
} --------------------编程问答-------------------- 哎,没人回答啊 --------------------编程问答-------------------- BtnClick Btn_Click --------------------编程问答-------------------- <TextBox Grid.Row="0" Grid.Column="1"
Text="{Binding Path=StudentID}" />
--------------------编程问答-------------------- WPF数据绑定 --------------------编程问答-------------------- 没有人了解么?在线等待中
补充:.NET技术 , C#