0
public class Emp
{
public string Id { get; set; }
}
I declared the class like this, but property i didnt set. I set the dependency property for textblock
public static readonly DependencyProperty LabelProperty
= DependencyProperty.Register("TextBlock", typeof(string), typeof(WindowsPhoneControl1), new PropertyMetadata(new PropertyChangedCallback(LabelChanged)));
public string List
{
get { return (string)GetValue(LabelProperty); }
set { SetValue(LabelProperty, value); }
}
沒有還我得到了相同的結果。沒有項目在列表中展示。綁定路徑是否正確,但是'Id'必須是公共屬性。我必須給datatemplate內的文本塊綁定什麼路徑 – 2012-08-03 11:26:06
綁定路徑可以,但是'Id'必須是公共屬性。您是否在Visual Studio輸出窗口中看到任何綁定錯誤消息? – Clemens 2012-08-03 11:37:12
輸出窗口中顯示沒有錯誤信息。 – 2012-08-06 05:41:39