R# can create resources for you in XAML

Tools No Comments »

I was aware for some time now that R# offers some support for editing XAML but I didn’t know the following features until recently.When you create a StaticResource in XAML, R# is able to help you by generating some code for you. The famous R# “bubble” shows up offering various options to create the resource:

Then the resource is automatically created for you:

Note that it works with converter too:

R# 5.0 has been released a couple of weeks ago. Go ahead and grab your copy !

BezierSegment demo application

WPF 3 Comments »

It has been a long time since my last post, I’m must admit I was both busy and trying to find something cool to blog about. Because I’ll be in holidays tomorrow, I decided to take some time to build a sample application that demonstrates a feature of WPF I’m going to use soon.

In the sample application (source code available here), you will be able to play with the BezierSegment class. I created a simple control that wrap the BezierSegment into something more easy to visualize.The application allows you to drag and drop points and to animate the line.

Here is the result:

bezierdemo

I hope you’ll like it ! The reason I’m going to use this class is in a diagramming control (like Visio) to connect shapes together…

Download the source code.

The future of WPF at Mix09

Events 1 Comment »

mix09

MIX09 is now over and the good news is that we can watch all sessions that have been recorded online !

I didn’t have time yet to watch all sessions I’m interested in, but I already saw “What”s new in WPF 4″ video (available here).

Here are the important points of this session regarding the future of WPF:

  • Lot of new things are coming in WPF4: Text clarity improved, Multi-touch, Windows7 integration, Ribbon control, Focus management improvements, Visual State Manager, Client profile, Themes, Chart controls and a lot of bug fixes
  • WPF4 will come together with .Net4 which brings its own set of cool new stuff: Dynamic Language, MEF, F#, parallel library
  • WPF will be the best choise for RAD under Windows7: Multi-touch, Taskbar integration, Ribbon, Common dialogs, File explorer customization…
  • Multi-touch support: UIElement changes to manage touch related events, touch support is added for some controls (ScrollViewer)
  • New composition API: developers can control graphical elements cached in video memory
  • Controls that are currently available in the WPF toolkit will be integrated into the platform (DataGrid, DatePicker…) – moreover an update of the toolkit has just been released
  • Developers tools are improved: VS2010 and Blend3 helps the usage of WPF (databinding support…)
  • .Net4 will come with a new XAML parser: faster, extensible, public API to manage BAML format
  • .Net4 XAML language has new XAML features: support for generics, better references by name

I hope will see a CTP soon so that we’ll start playing with those new features :-)

XAML guidelines: interviews of WPF masters

WPF 1 Comment »

Getting back to work this morning, I opened my Google Reader to have a look at the RSS feeds I’m reading.

I found a nice video on Channel9: “XAML Guidelines, Part 2”. The first episode, where Jaime Rodriguez interviews 3 people from Identity Mines is also available on Channel9 (unfortunately, the sound is rather poor on this episode…).

This time, Jaime meets up with Unni Ravindranathan from the Expression Blend team. During the shot, they open the Blend source code project inside Blend (sounds nice isn’t it :p). Unni explains the structure of the project, their conventions, how resources are used, etc.

I think Blend is an application we can learn a lot from. If you’re also interested to understand what architecture Blend uses, you can check out this post from Paul Stovell.

Here are some notes I took while watching the video:

  • Blend is shipped with 2 themes: Expression Light & Expression Dark
  • Blend resources are stored in (only !) 3 resources dictionaries
  • Resources are categorized into Colors, Brushes and Styles
  • Blend defines a set of margins and thicknesses that are used in the entire application to ensure a consistency across the different layouts
  • By convention, Name and Key properties are always defined first in the XAML
  • Properties might be spitted over several lines, if this is the case; properties are grouped together by types (style, size, appearance…)
  • Blend 3 will add extensibility and improve XAML code generation:
      - Name will always be the first property
      - Better control over how the XAML is formatted
  • Name everything versus name nothing? Blend names almost everything, it helps UI automation
  • Static resources versus dynamic resources? No big performance impact, Blend mostly uses dynamic resources
  • When design time doesn’t work fine in Blend
      - An exception can occur when Blend is creating the control because the running process is Blend itself and not the application we are creating
      - Add tests to check if code is running in design mode (you can use System.ComponentModel.DesignerProperties.GetIsInDesignMode(DependencyObject) method)
      - Debug Blend process by attaching an instance of Visual Studio to Blend
  • Blend is a big application:
      - 300 000 lines of XAML
      - 500 000 lines of C#

If you want more information about fixing error that we can have in Blend (while the application works properly at run time), you can check out this post of Jaime.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in