This is a migrated thread and some comments may be shown as answers.

Diagram ExportToImage in Background

2 Answers 69 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Deepak Shakya
Top achievements
Rank 1
Deepak Shakya asked on 16 Dec 2015, 02:48 AM

Hi,

 

Is it possible to process this method in background using BackgroundWorker or some other method using code-behind? My UI seems to freeze when I perform this as I have this hooked up to Diagram_MouseLeave event. It takes time as I have image as item in the background that gets written to a property in Viewmodel.

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan
Telerik team
answered on 17 Dec 2015, 02:21 PM
Hello Deepak Shakya,

The RadDiagram and it's children(shapes, connections, etc.) are UI elements and they are used by the UI thread. These elements and their properties can only be accessed and modified using the UI thread. Due to this reason the method ExportToImage cannot be processed in another thread as it needs access to properties of the visual elements.

However, if you need to access the UI thread from another thread you can do this using a Dispatcher. Please note that this will make all calculations in the UI thread.

Regards,
Ivan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Deepak Shakya
Top achievements
Rank 1
answered on 18 Dec 2015, 01:06 AM
Thanks for the answer Ivan. I don't this will work in my situation as it will have to access the UI thread and perform calculation there. I might have to assign this to button_click event.
Tags
Diagram
Asked by
Deepak Shakya
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Deepak Shakya
Top achievements
Rank 1
Share this question
or