TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Devendra Kumar
NA
500
164.2k
Thread safe Dependency Property in WPF
Jun 11 2020 3:50 PM
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
Reply
Answers (
3
)
How to set Combo box value in WPF using MVVM architecture
How to change datagrid colomun text margin ?