当我试图检查我的应用程序时,会出现错误:
暂停调度程序处理时无法执行此操作。
public string Value
{
get
{
string _Value = "";
//The next line throws the error:
Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
{
_Value = (string)GetValue(ValueProperty);
}));
return _Value;
}
set
{
Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
{
SetValue(ValueProperty, value);
}));
}
}
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(string), typeof(RaVariable), new FrameworkPropertyMetadata("0")
{
BindsTwoWayByDefault = true,
DefaultUpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
});
我不知道为什么会收到此错误。
任何人都可以帮助我吗?