This is supposed to be a Blog about the Blues and poetry—and the kintespace.com Web site, right? What about Amiri Baraka in Los Angeles last weekend…? Well, the mothers of my two youngest children went to see him Sunday night. That night, my youngest son tricked me into driving through a McDonald’s drive-through after his bedtime—I knew his mother would never take him to McDonalds… but, then again, one never knows until one knows…
Anyway WPF takes us from eventing and imperative data binding (in Windows Forms) to commanding and declarative data binding. This is a huge leap! The System.Windows.Data namespace and additions to System.ComponentModel (like ICollectionView) make this possible. More Josh-Smith source code:
ICollectionView collectionView = CollectionViewSource.GetDefaultView(this.Workspaces); if (collectionView != null) collectionView.MoveCurrentTo(workspace);
The Workspaces we see represent a collection of View Model objects—so don’t let that term “space” in Workspaces referring to a non-visual concern bug you (I’ll do that for you—hey, I’m the guy who coined kinté space). Okay, my point is that MoveCurrentTo() moves a View Model—only because this View Model is bound to a View (through a DataTemplate) do we see the UI update. I ranted about typed DataTemplate objects earlier. The declarative binding of typed DataTemplate objects makes this awesomeness possible!
All of this “workspace” switching in the UI has to be declared by a parent XAML element—that element should have a ContentControl.Content property. This property is bound to Workspaces in our example above like this:
<HeaderedContentControl
Content="{Binding Path=Workspaces}"
/>
This describes most of the ‘wiring’ mentioned in earlier. Okay. Great… Now, on to other non-poetry-related topics (it’s all poetry to me):
DispatcherObject extension methods by Eric De Carufel that I assume will come in handy when calling into the UI thread.This entry was posted on Tuesday, November 17th, 2009 at 8:33 am and is filed under .NET related, Data Management Solutions, Design Diary, Digital Media Production, Expression Studio, kinté space news, root. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.