when i use the method System.Windows.DependencyObject.GetValue, there is a error "The calling thread can't access the object, because another thread with the object", I do not use WPF , so I do not know why, is anyone have this problem once? Thanks.
I use the method as following:
public static readonly DependencyProperty NameProperty =DependencyProperty.Register("Name", typeof(string), typeof(ViNamedObject),
new FrameworkPropertyMetadata(string.Empty));
public string Name
{
get
{
string result;
try
{
result = (string)GetValue(NameProperty);
}
catch (Exception)
{
throw;
}
return result;
//return (string)GetValue(NameProperty);
}
set
{
if (string.IsNullOrEmpty(value))
ClearValue(NameProperty);
else
SetValue(NameProperty, value);
}
}
<link href="chrome-extension://bicdefpoleoohkhgcbbhambpghigfeid/build/index.css" rel="stylesheet" />