the rasx() context

I preach these Blues, then choose my seat and sit down.

Flippant Remarks, Yet Again about WPF/MVVM…

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):

  • In Jason Dolinger’s MVVM video, at about 1:10 he starts into getting static data to show up in Blend to make MVVM stuff designer-friendly.
  • Jason also shows where the decorator pattern is important when “wrapping” a WPF service object in a dispatcher.
  • I’m packing away DispatcherObject extension methods by Eric De Carufel that I assume will come in handy when calling into the UI thread.
Share and Enjoy:
  • del.icio.us
  • Facebook
  • Technorati
  • Digg
  • Slashdot
  • Google Bookmarks

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.

Leave a Reply

Please leave a comment. Comments are encouraged but they must contain relevant details. These details are very helpful when they refer to exactly what the author has written. Any appeals to “common sense” with usage of phrases like, “this is stupid” or “you are so ignorant” will be ignored. Also, any quick blurbs like, “this is great” or “good job” will be reluctantly suppressed. See you later… without blindness.

the rasx() context is proudly powered by WordPress
Entries (RSS) and Comments (RSS).