Search

Binding should check for cross thread calls by michiproep

Closed
as Not Reproducible Help for as Not Reproducible

1
0
Sign in
to vote
Type: Suggestion
ID: 624517
Opened: 11/25/2010 12:27:41 AM
Access Restriction: Public
0
Workaround(s)
WPF Binding should check for cross thread calls:
Let's say you have your GUI bound to your Model or ViewModel (MVVM) and a seperate thread checks for changes and updates the properties in the model, it would fire NotifyPropertyChanged in that second thread. The consequence is that a cross-thread-exception occurs.
Yes, you could implement a dispatcher mechanism in your model but what if the model is generated i.e. EntityFramework?
It would be easier and safer if the binding class does would implement the
"if(InvokeRequired)-pattern" itself!
Details (expand)

Visual Studio/Silverlight/Tooling version

.NET Framework 4

What category (if any) best represents this feedback?

Compatibility

Steps to reproduce

...

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

...

Expected results

...
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 4/8/2011 at 11:26 AM
Models may be manipulated on other threads, and the WPF Binding system already marshals the property changes to the UI thread. This has been like this for a very long time, so you must be experiencing some other problem. Please provide a repro if you need to reactivate this issue.

Of course, if the model itself has thread affinity than it can not be manipulated from a foreign thread.

Currently released versions of WPF do not marshal collection changes across threads, which is a well known limitation.
Posted by Microsoft on 11/25/2010 at 1:21 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.