0
我有一個堆棧面板,我已將其datacontext設置爲綁定中的自定義對象「問題」路徑,我在運行時添加框架元素並將textblock的屬性設置爲Binding(),它將QuestionAnswer顯示爲對象。我想顯示QuestionText。是因爲班級是抽象的嗎? 我有一個從問題答案一樣TextBoxQuestionAnswer,CheckboxQuestionAnswer等繼承Silverlight綁定問題
當我嘗試使用屏幕上的綁定(「TextBoxQuestionAnswer.QuestionText」)沒有顯示幾類
public class Page
{
public int PageID { get; set; }
public ObservableCollection<QuestionAnswer> Questions { get; set; }
}
public abstract class QuestionAnswer
{
public int QuestionID { get; set; }
public string QuestionText { get; set; }
public QuestionType QuestionType { get; set; }
public Dictionary<string, string> AnswerOptions { get; set; }
public string AnswerText { get; set; }
public AnswerResponse AnswerResponse { get; set; }
}
顯示您的代碼綁定 – Mediator