Real-world WPF
Resource-Not-Found Exceptions Because Blend Sets “Static” Instead of “Dynamic”
At design-time in Expression Blend you may bind an element property to an application-level data source. Apparently, by default, Blend sets the parent DataContext
of this binding to a static resource (because this is the most efficient reference and Blend has no way of knowing that another WPF control might load the visual tree containing your binding from another file—at design time). This default binding written by Blend can cause resource-not-found exceptions. This default binding should be manually changed from:DataContext={Binding Source={StaticResource MyViewModelKey}}
to this:DataContext={DynamicResource MyViewModelKey}
Using Excel to Write Code
I’m working on a WPF application with about 2300 static color references and about 50 known “theme” brushes. There has to be a way to manage and generate code based on this data—and Excel is my answer to this management question.
Using the Runtime Output Window in Visual Studio to See WPF Binding Errors
Binding in WPF is evaluated (mostly) during runtime (maybe at design-time sometime in Expression Blend). This is a serious issue for me and I just could not accept this limitation. A stackoverflow.com answer to my question from GreenReign leads to an article by Bea Stollnitz, “How can I debug WPF bindings?”—the situation is not very attractive.
WPF Technology Limitation: No “Tear Off” Windows
Those meddling kids on the Google Chrome stuck it to Redmond again: in my current WPF project, one of the (impossible) design goals is to replicate the tab functionality in Google Chrome. What this implies is that WPF should support out of the box multiple instance scenarios in the form of some kind of ‘tear-off-tab’ control. WPF does not.
WPF Technology Limitation: You Roll Your Own Custom Window Chrome
The concept of a “theme” in WPF refers to the Windows chrome (not to be confused with Google Chrome)—or (ultimately) the use of external ResourceDictionary
files. I’ve had problems with design-time ease and external resource files in Blend—Expression Blend simply can’t find them (even when in app.xaml
).
Messing about with Windows chrome can lead down (or up) the slippery slope to having to know how Windows internally handles, well, Windows. This can be a time-waster when you are doing scrum sprints (and you are not an ex-C++ dude).
Comments
tim, 2010-05-20 23:54:41
Did you ever get the tear off windows to work?
rasx(), 2010-05-21 20:27:45
No: not my personal or professional concern at this time.