Hello everyone,
I am working on a WPF project and found an issue ot thread calls.
I have a Dependency Property of a usercontrol as below
- public bool IsON
- {
- get { return (bool)GetValue(IsONProperty); }
- set { SetValue(IsONProperty, value); }
- }
When I access this property, an exception occurs "The calling thread cannot access this object because a different thread owns it"
I tried lock function with a readonly object but no luck.
Is there any solution to make it thread safe on user control side and not from the calling class because I want to handle it from usercontrol side, as the property was used several times
Thanks
Devendra