與匿名對象綁定在WP7.5,我創造了這樣一個DataContext:在WP7.5
this.DataContext = new { One = listOne, Two = listTwo};
在我的XAML代碼,我想這:
<TextBlock Text="{Binding listOne.m_strTypeTiers}" Style="{StaticResource PhoneTextNormalStyle}" />
<TextBlock Text="{Binding listTwo.m_strTypeTiers}" Style="{StaticResource PhoneTextNormalStyle}" />
我的文本框爲空,我認爲我的綁定語法有一個mystake。
任何人都可以幫助我嗎?
非常感謝
是什麼'this'指什麼?您可能還需要檢查您的輸出以獲取WPF綁定警告消息。 – JDB
我的xamlFile被命名爲page1.xaml,並且位於我的cs頁面上,名爲page1.xaml.cs。這是Page1.xaml.cs實例。 –
而且一件重要的事情是,如果我使「this.datacontext = ListOne」的綁定是好的。我的問題來自{one = ListOne,two = ListTwo}。 –