我有三弦的班级
例如:
class abc
{
public string a, b, c;
public abc(string d, string e, string f)
{
a = d;
b = e;
c = f;
}
};
private void button1_Click(object sender, RoutedEventArgs e)
{
abc obj = new abc("abc1","abc2","abc3");
var MainPage1 = new MainPage();
MainPage1.DataContext = obj;
}
当我试图绑上一个文字块时 它并不绑紧
<TextBlock Height="23" HorizontalAlignment="Left" Margin="201,66,0,0" Name="textBlock1" **Text="{Binding Path=a}"** VerticalAlignment="Top" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="201,107,0,0" Name="textBlock2" **Text="{Binding Path=b}"** VerticalAlignment="Top" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="201,156,0,0" Name="textBlock3" **Text="{Binding Path=c}"** VerticalAlignment="Top" />
我想我漏了点什么,但需要帮助才能找到它,谢谢。