Skip navigation

At the risk of sounding like a "blender", I will confess that I love the tool. But let me tell you about my workflow when using it.

  1. Rough UI First I drop all the elements I need for the UI onto the UserControl (either based on the mockup from our BA or based on my interpretation of the requirements.
  2. Layout After I get the elements onto the form, I use a grid to lay them out.
  3. Touch Up Usually Blend has put some interesting values for the width/height of my rows and columns. I go in and touch them up to make it cleaner (.9862378* becomes just *).
  4. Wire Up I use the MVC pattern for my WPF UI so I expose properties and events that are of interest to my UI. For example, if the user should have a choice of Countries to select as their mailing address, I expose a dependency property on my controller called AvailableCountries (it is the controller’s responsibility to properly initialize that list). In my xaml I might have a ComboBox with an ItemsSource="{Binding AvailableCountries}" attribute on it (I set the Controller as the DataContext of my UserControl). But this is NOT my post on MVC with WPF so I won’t bore you with anymore details. Needless to say, I spend the majority of my time here.

Now that I’ve given an alternative between the extremes of hand-coding all your XAML and doing everything with the Blend designer, let me tell you about another cool trick I noticed in blend. Remember the Attached property I showed you yesterday (IsGridSortable)? Well I was working with a solution in Blend that included the project that contained IsGridSortable and found this at the bottom of my property panel.

Thats right Blend gives me a simple checkbox (because it’s a boolean) that let’s me make my grid sortable. I guess I need to get into the Designer APIs to find out what I need to do to get my Attached Properties out of the Miscellaneous group.



  1. Mike,
    That\’s an interesting post.  You mentioned that this is "not my post on MVC in WPF"…but I\’d love to see one if you have it, or intend on writing one. 🙂
    Thanks,Josh Smith

  2. Josh,
      Thanks for the visit…I am indeed intending on writing a series on MVC with WPF. I was actually looking at using a recent sample that Eric Sink provided of a game he called Contagion, to show how I could take his "Raw Code" and apply the MVC pattern to it. I\’ll probably start that up next week…I also want to get the next part of my Code Climber series in place.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: