WPF应用中,点击某个按钮时提示系统卡住,随后崩溃
经过调试,系统提示Exception_WasThrown
原因:某个属性get 然后了它本身
代码
private DateTime endTime = DateTime.Today; public string EndTime { get { return EndTime; //正确 return endTime.ToString("yyyy-MM-dd HH:mm:ss"); } set { try { var endTimeTemp = DataHelper.ToDateTime(value).Value; endTime = endTimeTemp; RaisePropertyChanged(nameof(EndTime)); } catch (Exception ex) { SYCMessageBox.Show(ex.Message); } } }
修复后系统正常运行
标签:Exception,endTime,提示,WasThrown,EndTime,闪退,调试 From: https://www.cnblogs.com/lwinsoft/p/16905530.html