# 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, 27 February 2011

For record keeping purpose, here's we go.

DSC00507

Don't think I'll be getting the full set though.


Sunday, 27 February 2011 21:49:31 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 

This here is my LG Optimus 7

DSC00497

With it's Gorilla glass protected screen, it would have been ok to just carry it around naked like this. But that was before WZ realized that games on the Optimus 7 is different from games on the iPod, and he would like to have some variety... So I knew I needed some sort of drop protection since it would only be a matter of time before he dropped it while playing for one reason or another.

I decided I would just go for a simple bumper case, tried searching around the local shops but as expected it's not exactly a mass market device here so I couldn't find anything. So I turned to PDAir and found this.

DSC00498

The Luxury Silicone Case!!! The main reason I choose this instead of the soft plastic case was that from experience, those soft plastic case usually made it VERY hard to press the buttons that are covered by the case. So I figured soft silicone would be easier, that and yeah... I really wanted to find out how LUXURIOUS it was. (Curiosity killed the wallet in this case)

The main difference I found between this and other silicone cases I've seen is the surface texture, yes... it's a silicone case with a SURFACE TEXTURE.

DSC00493

It's not just plain smooth like other silicone cases I've seen, feels like some non smoothed leather to me. So... feels like leather means luxury?

The case works as it should, as a soft dampening bumper in case of drops. The main problem when using cases like this is that you've put a frame on your screen and therefore reaching the edges might be a bit tricky. Luckily since it's a silicone case it can be pushed aside easily.

One problem that I do have with it is that, when my hands are dry, and the case is dry. It feels smooth and SLIPPERLY to the touch, does make me worry that it might slip off if my hands are too dry!

Still unsure about the luxury title though!


Sunday, 27 February 2011 00:19:25 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Saturday, 26 February 2011

There are things which no matter how cheap they are, you just don't tell you wife that you bought it, since you'll most likely get the "What the bloody hell were you thinking?!?!?!" speech. This would be one of those things

DSC00483

Yup.. it's a plunger, and yup.. I bought 3 of them

DSC00485

It's hard to think imagine their function is until you see them in use

DSC00486

Yup, these are very small plungers. Basically what you do with them is press them onto any smooth backed device (or something stuck with a suction cup helper I bought in Daisho) and then you can use it as a stand for said device.

DSC00488

Of course, a lot of factors come into play, the device must have a smooth back to allow for maximum suction (that phrase sounds a bit wrong out of context), it works only on a stable surface, and if the device is too heavy it'd probably just collapse onto the poor plunger.

Well.. it works for phones pretty well.

DSC00491

If I made you curious enough to want to buy one of these, you can get it at weird gadget dealer DealExtreme, bonus points if you looked at the packaging picture and went "Oh, that's suprisingly appropriate!"


Saturday, 26 February 2011 23:59:30 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 

I’ve been hooking up my phone and my various portable players to my car audio system through the use of a preamp and a couple of cables, something which I’m sure a few people also do, anyway I end up with the setup below.

DSC01373

One of the problems that I was facing was that if I charged my device at the same time through the cigarette socket, there would be this ANNOYING hum that seem to be in sync with my engine. That has caused me a lot of headache since it meant that I can’t charge my device as well as listen to it at the same time, which is disastrous when it’s the phone we’re talking about. Even when I can stomach the humming noise, Wife Acceptance Factor is obviously very very VERY low with an annoying hum in the background.

Then I saw this thing hanging on a rack recently.

 DSC00476

This is the Kensington Noise-Reducing AUX Audio Cable it caught my eye because on the box it specifically said it’ll reduce the car engine humming noise. I figured I’ve got nothing more to lose anyway so I bought it and here are the results.

And it worked as advertised! No more annoying humming while charging means I can enjoy more music on the go then. Highly recommended if you’re facing the same problem with your audio setup.

On further research of the car humming problem (which I was spurred to do after so many years by this purchase) it would seem that this is most likely something called a ground loop isolator, and as such you could probably buy a cheaper unit in some audio equipment shop if you know what you’re looking for.

ps. I don’t have audiophile ears or equipment so I wouldn’t know how much signal degradation is happening through the use of this cable.


Saturday, 26 February 2011 17:13:24 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  |