我正在使用IDataErrorInfo繼承業務對象進行驗證。如何清除WPF IDataErrorInfo驗證錯誤
public string UserId { get; set; }
public string this[string columnName]
{
get
{
string result = null;
if (columnName == "UserId")
{
if (string.IsNullOrEmpty(UserId))
result = "Please enter User Id";
}
}
}
我想清除所有的驗證錯誤,當我點擊菜單上的按鈕 - 如 - 登出。
窗口使「登錄」面板可見,但前面板的驗證錯誤標記仍顯示在當前登錄面板中。
我嘗試了所有的選項指定NULL的datacontext,新鮮實體對象......但沒有運氣
我感謝你的幫助。