Archive for the 'WPF' Category

M-V-VM

January 7, 2009

Happy New Year! Hope 2009 is going well for everyone so far. Sorry for the lack of updates on the site. I was busy for the past few months preparing for Jing Pro’s release, but [unfortunately] most of my development was not WPF related.
Also, I have been learning Cocoa and iPhone development during my free [...]

Restarting a WPF app

December 17, 2008

We recently needed a way to easily restart a running Jing process, for reasons that will become apparent in an upcoming release, to which I stumbled on this entry from one of Rob Reylea’s blogs:
http://rrelyea.spaces.live.com/Blog/cns!167AD7A5AB58D5FE!2258.entry
Essentially, you make these two calls to restart a running WPF process:
System.Windows.Forms.Application.Restart();
System.Windows.Application.Current.Shutdown();
Be careful though. After confirming with Reflector, calling Shutdown() is [...]

Artifacting on Vista

August 19, 2008

Last week tech support kept telling us that Vista users were reporting really weird artifacts in the Launcher and our Preferences windows:

Since those two windows are layered windows, and layered windows have had performance problems in Vista until .NET 3.5 SP1, I wondered about it and stumbled on this MSDN article:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration
DWORD

The disable hardware acceleration option [...]

ListBox Grouping and Virtualization

February 22, 2008

I would like to give a big “Thanks!” to Microsoft’s Ben Carter for providing me the high-level solution to this difficult problem, and making work over the past month a little bit less frustrating.
Update 3/3/2008: I have reworked my solution to prevent virtualization from not working when sorting the ListBox with the CollectionView sort descriptors. [...]

WTF Moment: Object Lifetime Events

February 19, 2008

I was reading the MSDN docs for Object Lifetime Events (click and see highlighted portion):

Blindly believing this because having OnInitialized act as a bubbling event makes sense, I override OnInitialized for two panels, one nested inside the other. This was so that the two could communicate with each other by having the outer panel set [...]

Making a Virtualizing WrapPanel

February 6, 2008

If you use Jing, you may have noticed that loading times for the History bin can be really long. As discussed in this post, we’ve already implemented some techniques to improve this, except for one: implementing a virtualizing panel.
In response, I’ve spent the last two months implementing one to significantly cut down on loading times. [...]

WTF Moment: Data Binding Errors in ListBoxes

January 30, 2008

Let’s say you have a ListBox that is data-bound to an ObservableCollection and set up similar to this:

Also, assume you’ve implemented sorting on your collection using the CollectionView representing your data bound items.
Can you guess what’s wrong?
When you sort the items (you’re really sorting UI elements representing your data), a data binding error occurs for [...]

WTF Moment: Data Binding Error

January 8, 2008

A few weeks ago, I was updating Jing’s splash screen because of some underyling classes that I refactored when I encountered an exception thrown in a MultiBindingConverter for trying to read DependencyProperty.UnsetValue as an enum.
The MultiBindingConverter was blowing up in XAML that looked similar to:

After a few hours of gnashing my teeth, and cursing under [...]

Favorite WPF Utilities

January 4, 2008

I’ve compiled this list of WPF utilities that have helped me save time while debugging, profiling, and as a result make development under WPF much more productive and enjoyable:
Snoop
I can’t recommend this enough. Snoop let’s you view a window’s visual tree, glance at an element’s property values, check if there are any data binding errors, [...]

Lightweight Drawing with DrawingVisuals: Part 2 of 2

December 19, 2007

I apologize for writing this entry almost a month after the first part of this series. I was busy making the Sun Launcher draggable in the Windows version of Jing (which was pushed yesterday). Yay!
Anyhow, in this entry I will teach you how to do lightweight drawing with DrawingVisuals. Most visuals in WPF derive from [...]