| Re: [aus-dotnet] WPF UI Thread |
- From: Stephen Price
- Subject: Re: [aus-dotnet] WPF UI Thread
- Date: Wed, 25 Jul 2007 01:10:05 -0700
- Prev by Date: RE: [aus-dotnet] SPS 2003 web parts for AD publish/edit and Recycle Bin
- Next by Date: RE: [aus-dotnet] Anyone going to Gartner next week?
- Previous by thread: Re: [aus-dotnet] WPF UI Thread
- Next by thread: [aus-dotnet] SPS 2003 web parts for AD publish/edit and Recycle Bin
- Index(es):
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Looks like an XPS document is being created (not sure if it's a custom library or part of framework) and then doc.RenderList is being passed the ListView.My understanding of the design of this is that the view object is the view (in the sense of View, Presenter, Model) and that it's just printing the ListView. Comes out looking like a screenshot so the idea of creating a bitmap of the listview then print the bitmap might work. Will have a play. Can't spend too much time on it unfortunately...Thanks,Stephen
On 7/25/07, Paul Stovell < Paul.Stovell@xxxxxxxxxxx> wrote:
http://www.ericsink.com/wpf3d/3_Bitmap.html
RenderTargetBitmap bmp = new RenderTargetBitmap (
width, height, 96, 96, PixelFormats.Pbgra32);bmp.Render(myListView);
If it's the items from the ListView, perhaps you could extract the objects from the list first before printing them rather than passing the ListView as a reference. WPF UI elements like the ListView are tightly-bound to the dispatcher (thread) they were created on, and most properties/methods you try to call on them will fail if you call them from another thread.
Regards,
Paul Stovell
Readify | Senior Developer
Microsoft MVP: Visual Developer - Client Application DevelopmentM: +61 420 314 127 | C: paul.stovell@xxxxxxxxxxx | B: www.paulstovell.net
From: peter@xxxxxxxxxxx [mailto:peter@xxxxxxxxxxx] On Behalf Of Stephen Price
Sent: Wednesday, 25 July 2007 9:00 AM
To: dotnet@xxxxxxxxxxx
Subject: [aus-dotnet] WPF UI Thread
Hi all,
I've got a WPF problem I'm trying to work around.
I want to display a progress indicator, and have a control with a funky little animated thing on it, but the function I want to display the indicator during blocks the UI thread.
I tried putting an application.doevents() in after my indicator is called and it does show it but it doesnt animate. Dont have the code handy but the psudocode goes like;
displayProgress();
view.Print();
clearProgress();
with the result of the progress indicator being shown then cleared immediately so that you dont see it. (remove the clearProgress and it is shown after the print finishes.)
I think it's the way the view.Print is written... I tried it on its own thread but it seems to want objects in the UI (Its printing a listview).
thanks,
Stephen
(Click here for more information on the aus-dotnet mailling list)
