Page 1 of 1 in the Net category
# Thursday, 03 March 2011

From personal experience, and then what I gathered on the web. That question seem to be asked A LOT! The main issue here is that by default the WPF Listbox scrolls item by item due to control virtualizing, which means it only creates visual controls when needed. This is vital for good performance if you decide to bind a large item source to the listbox, say… a few hundred items?

Unfortunately without smooth scrolling, most people find the item based scrolling very sudden and jarring and overall a bad user experience. For me the effect was even worse on my project that was for a touch based application, item based scrolling just wouldn't work!

Turning off control virtualization was not an option because of the amount of data my project needed to handle.

So I did what I took a deep dive and starting reading up on how to create a layout panel, how does control virtualization work in wpf, how to support scrolling.

And I came up with this.

An ItemPanel that performs control virtualizing AND implements IScrollInfo. You can get the sample here. So now you too can have a listbox in WPF that supports smooth scrolling AND item virtualizing.

It wasn't too hard to make it actually, all the code was available around the net in separate places, I have no idea why no one had put this together before. Or maybe I wasn't looking hard enough?

Problems With The Code

  • The control was designed to work specifically with my project, you should read up on all the links I included in the SmoothVirtualizedPanel.vb file and understand how things work before wondering why it blows up.
  • There are parts of the code (particularly in dealing with the ItemGenerator) which I'm not sure how or why it works. So it might blow up in your face.
  • If you have no idea what an ItemPanel is, you really should read up on all the links I put on top of the source file before trying to do anything else.

This is pretty much research quality code, and hasn't gone through any optimization and proper error handling yet so copy and pasters beware.

Oh… did I mention the code is in Visual Basic? ;)

Thursday, 03 March 2011 03:38:11 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Sunday, 29 March 2009

I've finished my little proof of concept application that's using Windows Presentation Foundation. And I'm EXTREMELY pleased with the results, performance under Windows XP feels just the same and I guess it should be better once I actually optimize the handling of media.

All in all, while I was once afraid and skeptical about using WPF as a platform for writing Windows Client applications making the POC has changed that mindset for me. And now I'm glad I have WPF as a tool in my belt.

Though I wish they'd make it easier to hide the darn text input caret for the RichTextBox! Had to go through an ugly ugly hack just to do that!

Sunday, 29 March 2009 02:02:53 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Wednesday, 25 March 2009

I had my doubts before but after running some initial tests, I must say I'm VERY pleased with the results. I have a project that requires me to layout items for PRINT, and if you don't know how hard is it to write printing code, then you never wrote printing code before. :P

But... with WPF, making a print function which prints the way you want it to print is so... so... TRIVIAL that I'm almost ready to say to hell with any performance issues WPF needs to be used to fulfill the project's main objective!

I'll make a more complete POC and then if it runs fine on my eeePC then I'm gonna commit to using WPF on the project.

Wednesday, 25 March 2009 02:16:05 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Tuesday, 16 December 2008

So the new year is coming and what better way to start the year than by learning something new? There’s a Technet MSDN technology summit that’ll be happening on 15th January 2009 over at the KL Convention center. And there’ll be demos of the MS Virtualization platform, and more interesting to me would be that there’ll be sessions on AZURE, yum yum indeed.

Oh there’ll also be a demo of Windows 7 for those of you who like me haven’t bothered to acquire the preview released during PDC.

And maybe… just maybe.. and this is just ME saying this.

We *might* actually get a new Beta of Windows 7.

Just remember.. operative word here is *MIGHT*… with asterisks too!

Tuesday, 16 December 2008 22:15:38 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Thursday, 14 August 2008

Bit late here, but I'll just add in to the noise on the net about this. SP1 for both Visual Studio 2008 and .Net Framework 3.5 has been released, other than patching up problems SP1 also includes some new nifty ADO.Net features so check it out now!

Visual Studio 2008 SP1

.Net Framework 3.5 SP1

Thursday, 14 August 2008 09:58:25 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Monday, 31 March 2008

The local launch event for the 2k8 suite of apps. ie. Visual Studio 2k8, Windows Server 2k8 and SQL Server 2k8. Is happening next Tuesday, register now to try and snag some nice freebies! And of course to learn more about the apps lar.

Monday, 31 March 2008 11:46:43 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Tuesday, 20 November 2007

Wow... that was fast.. Anyway, if you have an MSDN subscription, it's time to head on over to the MSDN Subscription page to download it now.

If you're a student or hobbyist developer run and download the Visual Studio 2008 Express Editions now!

One good point about VS2008 is that it's supposedly about to target .Net Framework 2.0, 3.0(*sic*) and 3.5 That's great, because as much as I want to use the new IDE, I still have projects ongoing on .Net 2.0, unfortunately since I'm in the middle of a project right now I'll only be able to upgrade my main development machine later.

The U1010 on the other hand... is highly anticipating an installation of Visual Web Developer 2008 Express!

Tuesday, 20 November 2007 09:52:59 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
Page 1 of 1 in the Net category