Portland Silverlight User Group 10 Aug 2010

July 25, 2010

On 10 Aug 2010, Adam Kinney and I will be presenting at the Portland Silverlight User Group.

As you know I work on the WPF & Silverlight Designer in Visual Studio as part of the Expression Team.

This session will provide guidance for writing applications that are toolable.  Many folks use the term, Blendable.

Do you use MEF, IoC or Service Locator to resolve dependencies?  Do you use M-V-VM or code-behind click handlers? Do you use sample data?  No problem. 

We’ll show you how to have a successful design-time experience with the Visual Studio and Expression Blend tools.

Session Abstract

Building toolable Silverlight applications that enable the designer developer workflow

Warning: We won’t be 20 seconds into this session before mashing the gas pedal to the floor. After looking at the XAML tools Blend & Cider, we’ll dive deep into toolable application design.

Toolable applications not only enhance the initial development experience but also provide benefits to long term application maintenance.

An additional benefit is the enabling of the designer developer workflow. See the two roles played out in the presentation as they collaborate without clobbering each other.

BlueCiderLogo_4

Wanting to properly represent the WPF & Silverlight Designer, I’ll be sporting a nice XAML blue do. 

Just look for the guy with a red Hawaiian shirt with blue hair.

See you in Portland!

Just a grain of sand on the worlds beaches.


d:DesignInstance, d:DesignData in Visual Studio 2010 Beta2

October 28, 2009

The WPF and Silverlight Designer for Visual Studio 2010 shares several new design time (d:) properties and design time MarkupExtensions with Expression Blend 3 that provide necessary information for the WPF and Silverlight Designer to deliver a great editing experience.

I have explained the d:DesignData MarkupExtension in detail in this blog post:  Visual Studio 2010 Beta2 Sample Data Project Templates.

In this post I’ll cover the d:DataContext property and the d:DesignInstance MarkupExtension.

d:DataContext

d:DataContext gives developers the ability to set a design time d:DataContext that is separate and independent of the run-time DataContext property.

This feature solves the problem of developers wanting to set their DataContext programmatically but also wanting design time data.

All d: properties are ignored during compilation and are not part of any run-time assemblies.

d:DesignInstance

Purpose:  Provides a design time shape to the d:DataContext its applied to.

Example:  In the below snippet the Person class is the shape provided by d:DesignInstance to the Grid’s d:DataContext.

<Grid d:DataContext="{d:DesignInstance local:Person}">

Note: In the above example, the Person class is actually a faux type (fake or substitute type).  This faux type enables types that are not creatable to be created and their properties exposed as a shape.  See the below section on creating creatable types.

Usage:  So, now that the d:DataContext has shape, what can I do with it?

The shape is used by the new Binding Builder to expose the properties of the type in d:DataContext.  You can see in the below image, the four properties exposed by the Person class.

BindingBuilder

The Binding Builder is opened by clicking or right clicking on the Property Marker in the Properties Window.  The Property Marker is the icon to the right of the property name.  The Binding Builder is a GUI for editing bindings in WPF and Silverlight.  This is a super feature

The Cider Team has a great explanation of the new features on WindowsClient.net that you can read here: Setting Up Visual Studio for WPF and Silverlight Development.  There is an article and video.

You can read additional Cider Team Online material here:  WPF and Silverlight Designer for Visual Studio 2010.  We are in the process of adding many more articles.  While the material is initially geared for developers coming from other platforms to WPF or Silverlight, it has a lot of great information even for the seasoned XAML Head.  Yea, I said it.  I’m a XAML Head too and proud of it.  (LOL)

Without d:DesignInstance, d:DesignData or d:Source applied to a CollectionViewSource the Binding Builder would have no way to determine shape and provide a list of properties.

Note:  If d:DataContext is not set, but DataContext is set and has a created type assigned to it, this will also supply shape that the Binding Builder can use for listing properties.

Creating Creatable Types

 <Grid d:DataContext="{d:DesignInstance local:Person, IsDesignTimeCreatable=True}">

d:DesignInstance provides a technique for creating a non-faux type.  Setting the property IsDesignTimeCreatable to True on the d:DesignInstance MarkupExtension enables this.

Links

MSDN d:DesignInstance Walkthrough

Video showing d:DesignData and d:DesignInstance can be viewed from this blog post:  Visual Studio 2010 Beta2 Sample Data Project Templates.

The above post also has source code for sample data templates.  There four of the templates are tutorial walkthroughs on this topic and sample data.

The two .xaml files in the DesignInstance Samples folder are the walkthroughs.  You can create this project in VB.NET or C# by using one of the below templates when creating your project.

  • VB WPF Application DesignData Sample – VB.NET Sample WPF Application that demonstrates consuming sample data.
  • CS WPF Application DesignData Sample – C# Sample WPF Application that demonstrates consuming sample data.

DesignInstanceExamples

Close

Hope you find d:DesignInstance and d:DesignData Sample Data in Visual Studio 2010 Beta2 a productive feature for your application development.

Have a great day,

Just a grain of sand on the worlds beaches.


Silverlight-3 FireStarter 17 Sept 2009

August 11, 2009

On 17 September you have a wonderful and free opportunity to kick-start your Silverlight and Blend 3 skills. 

I’ve started writing Silverlight 3 applications and love where this platform currently is and where it’s heading.

Come join us in Redmond or watch online this exciting day of practical learning that you can apply immediately.

Event Overview (copied from the registration page)

This summer’s biggest blockbuster technology event is coming to Redmond, WA on the 17th of September.

Register to attend the Silverlight-3 FireStarter event on Thursday, the 17th of September.

We have a stellar speaker line up from the Microsoft roster. We will have Scott Guthrie keynote the event followed by presentations from Tim Heuer, Brad Abrams, Karl Shifflett and others.

At this event we will focus on three areas:

  • What’s latest and greatest in with the latest release of Silverlight
  • What’s happening in the world of Expression 3
  • Give you a run down on .NET RIA Services, Toolkit, etc.

Registration

Register to attend in person (Microsoft Campus Redmond, WA).

Register to attend online.

Schedule

FireStarter

Have a great day,

Just a grain of sand on the worlds beaches.


Expression Blend Spell Checking

January 6, 2008

I feel like I should file this under, “last to know.”  But maybe, there is another Microsoft Expression Blend developer out there that could use a cool Blend user tip, Spell Checking.  Actually, I found this out by making a mistake, then seeing Blend squawk about my spelling skills!

Step One: Blend makes is super easy to edit TextBlocks.  Select the TextBlock, then right-click and select Edit Text from the context menu as in the image below.

Blend Spell Check One

 Step Two: In edit mode, the words Blend is not fond of are underlined in red.  To have a look at possible corrections, right-click the misspelled word and select the desired correct word from the context menu. 

 Blend Spell Check Two

Have a great day.

Just a grain of sand on the worlds beaches.


Blend Presentation Materials From Columbia SC Updated 11 Aug 2007

August 11, 2007

During testing of my incrememting textbox that functions like the one in Microsoft Blend, I had on occasion noticed a fly in the ointment.  What would happen was that the textbox would continue to increment even though the mouse was no longer down or near the textbox in question.

This morning I’m reading from Charles Petzold’s book, “Applications = Code + Markup” and was reading about the CaptureMouse method on UIElements.  Turns out, this method is exactly what I need to ensure that textbox functions correctly.

 You can download the updated code in the below presentation.

The basic problem was that under certain circumstances, the textbox was not receiving the OnMouseUp event.  This is the event where all clean up was being done.

So to ensure clean up always gets performed, I’ve added in the counter part to CaptureMouse which is OnLostMouseCapture.  By placing clean up code in OnLostMouseCapture, I ensure that the textbox clean up routines always run, even if the control never receives the OnMouseUp event.

Have a great day,

Karl

Just a grain of sand on the worlds beaches.


Blend Presestation Materials – Columbia, SC

August 8, 2007

Presentation Materials From Columbia Enterprise Developers GUILD Meeting 8-8-2007

The below down load contains :

1.  The Blend presentation PowerPoint
2.  Hello World A La Blend code and program
3.  VB.NET Win Forms Take Home Pay Calculator application (this was used as the model for the WPF application)
4.  Updated WPFTaxCalculator code and program

YOU MUST - after using the below link to download the file, you MUST change the extenstion to .zip.  This is a requirement of WordPress.com.

Blend Presentation Materials From Columbia SC Updated 11 Aug 2007 

Cool Features In The WPF Tax Calculator Program

1.  Custom textbox that increments it’s value using the mouse just like Microsoft Expression Blend. 
2. The coolest tooltip. (Code shows you how to databind inside a resource back to the parent control that spawned the tooltip!)
3.  Data binding to a .Net 1.1 .dll by wrapping the class to conform to the WPF model for UI notification of property changes.
4.  A fully reusable Formatting Converter.  Handles all .Net formatting codes for fields.  Super easy to use in WPF UI.
5.  Using Enum element names to populate the combo boxes.
6.  Two result charts displayed in 3D space.

I learned so much about WPF and Blend while preparing this presentation.

Have a great day,

 Karl

Just a grain of sand on the worlds beaches.


Follow

Get every new post delivered to your Inbox.

Join 246 other followers