Sample Data in the WPF and Silverlight Designer

June 30, 2010

I just posted a comprehensive article on Sample Data in the Visual Studio 2010 WPF and Silverlight Designer here.

This article is scenario based and fully explains sample data in WPF and Silverlight.

It includes code sample in C# and VB.NET.

Have a great day,

Just a grain of sand on the worlds beaches.


Seattle Silverlight User Group – Windows Phone 7 Summer Series

June 30, 2010

The Seattle Silverlight User Group meets at the Redmond Campus building 40/41 Cafeteria the first Wednesday of every month.

On Wednesday, 7 July we begin the Summer Series on Windows Phone 7. With the help of Jaime Rodriquez and other Microsoft folks we will be getting down and dirty with Windows Phone 7 and getting to the meat of real Windows Phone 7 development.

This is a fantastic and free opportunity to learn the Windows Phone 7 API’s, get practical How To information from developers doing Windows Phone 7 development.  These summer sessions will jump start your development and allow you to meet other developers in the Redmond/Bellevue/Seattle area.

Have a great day,

Just a grain of sand on the worlds beaches.


Visual Studio 2010 WPF Trace Settings Default Is Incorrect

June 24, 2010

A few weeks ago I found that after setting the attached property PresentationTraceSources.TraceLevel=High on a binding, I was not getting the expected verbose output.

You can see an obvious error in the Path property name. 

<TextBlock 
    Text="{Binding diag:PresentationTraceSources.TraceLevel=High,  
            Path=XCustomerID}" />

Using the above in WPF 3.5 SP1 would result in many messages being outputted in the Debugger Output Window.

However, in Visual Studio 2010 WPF 4.0 I was only seeing the below single binding error:

System.Windows.Data Error: 40 : BindingExpression path error: ‘XCustomerID’ property not found on ‘object’ ”ListCollectionView’ (HashCode=55179487)’. BindingExpression:Path=XCustomerID; DataItem=’ListCollectionView’ (HashCode=55179487); target element is ‘TextBlock’ (Name=’CustomerIDTextBlock’); target property is ‘Text’ (type ‘String’)

The reason the expected messages are not being outputted is because the installation default setting of the WPF Trace Settings is “Error” and not “Warning.”  When set to “Error”, no “Warning” messages will be outputted.

To enable the PresentationTraceSources.TraceLevel messages to be seen, you need to change your Tools, Options, Debugging, Output Window, WPF Trace Settings, Data Binding value to Warning as I’ve done in the below image.

ToolsOptionsDataBinding

Have a great day writing your applications!,

Just a grain of sand on the worlds beaches.


WPF and Silverlight Designer, Hey I’m Over Here!

June 15, 2010

BlueCiderLogo_4

In the past two weeks, including a lunch meeting with an MVP yesterday, I have ran into developers that don’t take advantage of the productivity features in the Visual Studio 2010 WPF and Silverlight Designer.  They told me they didn’t realize the Designer was a good tool now.

As you know, I’m a die-hard XAML Head, I love .NET’s other first class language, XAML. 

Just know that the Designer has come so far in this release, you should do yourself a favor and use it.  By the way, since you paid for Visual Studio 2010, you need to get your money’s worth in productivity gains.

Below are some of the Designer features I really like:

Layout Features

  • No more quadrant algorithm; that annoyance of the Designer trying to help you too much; gone!
  • Designer Context Menu
    • Reset layout makes it super fast to set a control to consume space provided by parent
    • Grid has Row/Column Insert, Move and Delete
  • Margin, Edge, Text Baseline snap lines and adorners
  • Grid rail adorner allows setting height/width (Star, Auto or Pixel sizing)
  • Designer highlights the drop target when dragging and dropping

Properties Window Features

Note: These features work in the XAML Editor view also, provided you loaded the designer.  See my post here, read the section “Binding Builder in XAML View, it explains about Designer loading.

  • Binding Builder
  • Resource Picker
  • Image Picker
  • Extract Value to Resource
  • Go To Definition
  • Much improved collection editors
  • Brush Editor
  • Three ways to sort, Alpha, Category, Value Source (displays locally set properties at the top)

Data Sources Window Features

If you are a Data Sources Window person, watch these three videos and read the next two blog posts.  This will really help you get the most from the Data Sources Window.

TechEd 2010: Rocky Lhotka, Using the MVVM Design Pattern with the Microsoft Visual Studio 2010 XAML Designer

TechEd 2010: Cider Team, Making the Most of the Microsoft Silverlight and WPF Designer in Microsoft Visual Studio 2010

Cider Team: Lap around the WPF Designer creating a data bound application

Cider Blog: Create WPF Master – Detail UI Using Data Sources Window Object DataSource

Cider Blog: Create Silverlight Master – Detail UI Using Data Sources Window Object DataSource

Control Design-Times

You can easily extend the current WPF or Silverlight control design-times or write great design-time experiences for your controls.  I have blogged about doing this here.

WPF and Silverlight Designer Team Blog (Cider Team)

You can stay current with techniques and updates by checking out the Cider Team blog.

Close

Don’t forget to keep your Designer up-to-date.  You do this in two ways; by installing new versions of Silverlight Tools for Visual Studio 2010 and installing any service packs when they come out.

Silverlight Tools for Visual Studio updates the Designer, so even if you don’t currently developer Silverlight applications, you need to install this update.

You can read about the latest Silverlight Tools for Visual Studio here.

Have a great day,

Just a grain of sand on the worlds beaches.


WPF and Silverlight UserControls at Design Time

June 14, 2010

I have just blogged about UserControls in the Visual Stuido 2010 WPF and Silverlight Designer on the Cider Team blog. 

This fast reading post contains a short introduction to UserControls then covers the below sections that even the most seasoned WPF and Silverlight developer will want to read:

  • Automatically Populate Toolbox Items (covers this new feature and how to enable/disable)
  • Root Object and Instances of Controls at Design-time (covers when Design time code actually runs)
  • Running Code in a Constructor (if you do this, you should read this)

Have a great day,

Just a grain of sand on the worlds beaches.


Follow

Get every new post delivered to your Inbox.

Join 241 other followers