WPF: ListBox Background Image

One thing I really enjoy doing is duplicating effects in WPF that I’ve seen in other applications. One I like a lot for directory browsers and content browsers is the background watermark. Windows XP had them on the special directories, like ‘My Pictures’ and ‘My Music’. It seems to have vanished from Windows 7, but I thought I would try to recreate it in WPF.

All you need to do is replace the ListBox control template. What we’re going to do is just insert an image in between the border and the ScrollViewer. This will give us an image that is always visible in the same location even when the content is scrolled.