-
May 19th, 2016, 01:29 AM
#1
Thread Starter
Banned
secondary thread
What should I do for my wpf grid to receive and handle data although notifications arrive from a secondary thread.
-
May 19th, 2016, 01:47 AM
#2
Re: secondary thread
Any changes to the grid will need to occur on the UI thread. Follow the CodeBank link in my signature below and check out my thread on Accessing Controls From Worker Threads. It was originally posted with Windows Forms in mind but there is a post later on that provides a WPF implementation of the same thing. You can use that if your code is in a Window. If it's not then you can use the SynchronizationContext example provided in that same thread.
-
May 19th, 2016, 09:37 AM
#3
Re: secondary thread
See article below as reference. The code snippet utilized a TextBlock control. Same concept can be applied to a WPF DataGrid.
Accessing WPF controls on a non UI Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|