Silverlight - how to render image from non-visible data bound user control?

Posted by MagicMax on Stack Overflow See other posts from Stack Overflow or by MagicMax
Published on 2010-04-28T20:05:03Z Indexed on 2010/04/28 20:07 UTC
Read the original article Hit count: 372

Hello!

I have such situation - I'd like to build timeline control. So I have UserControl and ItemsControl on it (every row represents some person). The ItemsControl contains another ItemsControl as ItemsControl.ItemTemplate - it shows e.g. events for the person arranged by event's date.

So it looks as some kind of grid with dates as a column headers and e.g. peoples as row headers. ........................|.2010.01.01.....2010.01.02.....2010.01.03
Adam Smith....|......[some event#1].....[some event#2]......

John Dow.......|...[some event#3].....[some event#4].........

I can have a lot of persons (ItemsControl #1 - 100-200 items) and a lot of events occured by some day (1-10-30 events per person in one day)

the problem is that when user scrolls ItemsControl #1/#2 it happened toooo sloooooowwww due to a lot of elements should be rendered in one time (as I have e.g. a bit of text boxes and other elements in description of particular event)

Question #1 - how can I improve it? May be somebody knows better way to build such user control? I have to mention that I'm using custom Virtual panel, based on some custom Virtual panel implementation found somewhere in internet...

Question #2 - I'd like to make image with help of WriteableBitmap and render data bound control to image and to show image instead of a lot of elements. Problem is that I'm trying to render invisible data bound control (created in code behind) and it has actualWidth/Height equals to zero (so nothing rendered). How can I solve it?

Thank you very much for you help!

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about render