XamlResource.com
Since today XamlResource.com is officially in beta. Its purpose is to create a platform to find and share resources for Silverlight and WPF, resources in the form of Xaml. Have a look around and if you run into issues, please let us know at xaml@hotmail.nl.
Beta 1:
In Beta 1 only a few of the final categories are supported:
- Colors; Resources of type SolidColorBrush
- Gradients; Resources of type GradientBrush
- Color sets; 2 to 5 resources of type SolidColorBrush
- Vectors; Resources of type StreamGeometry
This list will be extended with Styles, Themes, Templates and Shaders.
Future plans:
- Adding tags and searching by them.
- Access to the site from within Expression Blend
- Client side validation of entered xaml using Silverlight
- Automatic generation of preview image
- Download multiple resources at once in one ResourceDictionary
- An rss feed for news items
If you have requests for features you can let them know by using http://XamlResource.uservoice.com. For anything else, send an email to xaml@hotmail.nl.
To keep up to date, follow us at http://twitter.com/XamlResource

MVVM Project and Item Templates
Intro
This is the first in a series of small articles about what is new in Silverlight 4 and Expression Blend 4. The series is build around a open source demo application SilverAmp which is available on http://SilverAmp.CodePlex.com.
MVVM Project and Item Templates
Expression Blend has got a new project template to get started with a Model-View-ViewModel project easily. The template provides you with a View and a ViewModel bound together. It also adds the ViewModel to the SampleData of your project. It is available for both Silverlight and Wpf.
To get going, start a new project in Expression Blend and select Silverlight DataBound Application from the Silverlight project type. In this case I named the project DemoTest1.
The solution now contains several folders:
- SampleData; which contains a data to show in Blend
- ViewModels; starts with one file, MainViewModel.cs
- Views; containing MainView.xaml with codebehind used for binding with the MainViewModel class.
- and your regular App.xaml and MainPage.xaml
The MainViewModel class contains a sample property and a sample method. Both the property and the method are used in the MainView control. The MainView control is a regular UserControl and is placed in the MainPage.
You can continue on building your applicaition by adding your own properties and methods to the ViewModel and adding controls to the View.
Adding Views with ViewModels is very easy too. The guys at Microsoft where nice enough to add a new Item template too: a UserControl with ViewModel. If you add this new item to the root of your solution it will add the .xaml file to the views folder and a .cs file to the ViewModels folder.
Conclusion
The databound Application project type is a great to get your MVVM based project started. It also functions a great source of information about how to connect it all together.
Enabling Multi-touch gestures in WPF using Expression Blend 4 RC and the TranslateZoomRotate behavior
I’ve already blogged about adding multi-touch support to Silverlight applications using Blend behaviors (you can also read my italian language article).
This is a powerful and simple approach which is now available in WPF using Expression Blend 4 RC and the TranslateZoomRotateBehavior.
Let’s try to build a simple example:
1 – Open Expression Blend and create a new WPF project:
2 – Drag a Rectangle in the MainWindows.xaml:
3 – Let’s add multi-touch gestures and inertia effects to the rectangle selecting the Assets->Behavior tab and dragging the TranslateZoomRotateBehavior inside the rectangle:
4 – Let’s examine the Properties:
It’s possible to set the supported gestures (All, None, TranslateX, TranslateY, Rotate, Scale), the constrainToParentBounds modality, the Minimum, Maximum Scale and the Rotational and Translate Friction associated to the inertia.
Let’s select the constrainToParentBounds check box and run the project using the Project->Run Project menu:
Cool, Multi-touch and inertia effects are now enabled for the rectangle without writing a line of code!
And this is the generated xaml:
<Window xmlns="http://schemas.microsoft.com/winfx/ 2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/ 2006/xaml" xmlns:i="http://schemas.microsoft.com/expression/ 2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/ 2010/interactions" x:Class="WpfApplication1.MainWindow" x:Name="Window" Title="MainWindow" UseLayoutRounding="True" Width="640" Height="480"> <Grid x:Name="LayoutRoot"> <Rectangle Margin="149,106,133,191" Stroke="Black"> <i:Interaction.Behaviors> <ei:TranslateZoomRotateBehavior ConstrainToParentBounds="True"/> </i:Interaction.Behaviors> <Rectangle.Fill> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="Black" Offset="0"/> <GradientStop Color="#FF8F98CA" Offset="1"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> </Grid> </Window>
The source code of the project is available for download here.
WPF Goodies in the Silverlight 4 Tools
If you haven’t heard already, the Silverlight Tools for VS2010 have been released, as mentioned by fellow ElegantCoder Bill Moore. In this release there have been some great improvements to the Visual Studio designer that work for both Silverlight and WPF. Lets check them out.
Go To Value Definition
Have you ever had a control that had a style assigned to it, but had no idea where to find that style? It could be nested down in some obscure folder path in a ResourceDictionary somewhere. You would have to do the good-old “ctrl + F” and do a search for it. Well, no longer. You can now go to the style value definition just by using the property inspector.
And when you click that magic button, it takes you straight to its definition.
Style Intellisense
A big pain for writing styles is that you have to hope you are setting the correct properties, and not fat-fingering them (misspelling). Well, never fear, Style intellisense is here. Never guess which property to use in the setter again.
Grid manipulation with a simple right-click
The source of my biggest headaches comes from the Grid. Yes the Grid. Because it can be a real pain to change once you have it created. Lets say that I have laid out my nice beautiful form, and all of a sudden realize I put a row in the wrong order. Well, I have to go into my XAML and update all my Grid attached properties for all the controls affected.
Not anymore! With a simple right-click I can now move, insert, and delete rows and columns from my grid. I just have to select any control in the row/column I want to manipulate, right-click it, then make my selection. In this case I chose to move an entire row down one level.
As you can see, not just the control I selected moves, but the entire row moves with it.
As you can see, the Silverlight Tools for VS2010 aren’t just for Silverlight developers. Even WPF peeps get a little love.
Check out this video which shows theses features in action.
KoodibooK Book Publishing – WPF, Silverlight, ASP.NET MVC2, Azure
Earlier in the year I dropped in to see some former colleagues of mine who are working on a new product/service called KoodibooK at their software company in Bath (UK). KoodibooK is a product that allows you to build up a set of photographs into a book, publish that book to an online store and then buy copies of the book that you made or, equally, books that other people have made and published. I really like the application - you can try it yourself in beta from http://www.koodibook.com – it looks great and “feels” really slick, snappy and just “friendly” to use. I’ve put together photograph books like this before myself using iPhoto on my Mac and I hadn’t come across a Windows solution quite as rich as this one – I plan to try it for my next photo book and see how it works out. On the tech side - what I really found interesting was that the client applications and the websites/services that the guys have brought together cover such a wide range of the Microsoft stack. The book creation part of the application...(read more)TechDays UK – Client Development Sessions (80%) Available
Microsoft Surface Toolkit for Windows Touch Beta available for download
“The Microsoft Surface Toolkit for Windows Touch Beta is a set of controls, APIs, templates, sample applications and documentation currently available for Surface developers.
With the .NET Framework 4.0, Windows Presentation Framework 4.0 (WPF), and this toolkit, Windows Touch developers can quickly and consistently create advanced multitouch applications for Windows Touch PCs.
This toolkit also provides a jump-start for Surface application developers to prepare for the next version of Microsoft Surface. Use it to take advantage of the innovative Surface technology and user interface to develop your own rich and intuitive multitouch experiences for a variety of Windows Touch devices.”
Links:
- Original post - Lunch: Microsoft Surface Toolkit for Windows Touch Beta
- Download - Microsoft Surface Toolkit for Windows Touch Beta
- Video - Introduction to the toolkit on Channel 9
Enjoy!
ASP.NET Pivot Grid Control Supports New Layout – v2010 vol 1
The ASPxPivotGrid will now support a slick new feature that will help save you screen space:
Compact Layout for Hierarchical Row Values
With DXperience v2010 vol 1, you can create compact layouts for hierarchical pivot table row values (this capability is also available in the WinForms and WPF versions of this control).
The compact layout allows you get more space horizontally without sacrificing the distinction between the hierarchical row values:
DXperience? What's That?
DXperience is the .NET developer's secret weapon. Get full access to a complete suite of professional components that let you instantly drop in new features, designer styles and fast performance for your applications. Try a fully-functional version of DXperience for free now: http://www.devexpress.com/Downloads/NET/
Visual Studio: Open in Full XAML View by Default
So I am using Visual Studio 2008 for developing WPF and Silverlight applications. The one thing that really annoys me is when I open a .XAML file and then Visual Studio automatically opens the file in split view mode. I am sure you are well aware of how VS 2008 support for the preview pane blows. So now I have to sit and wait for VS to render my view in the preview pane, and sometimes it can take a while, if it doesn’t just completely crash. Sometimes I take the extra time to go grab a snack and beverage of my choice.
So here is a hidden performance increasing jewel you might find useful. We can set the default open mode to be in full XAML view.
First thing you need to do is in Visual Studio go to your Tools ==> Options ==> Text Editor ==> XAML ==> Miscellaneous. There you will see an option for “Always open documents in full XAML view”. Check that box.
Now every time you open a XAML file it will open in full XAML view and give you one less thing to gripe about.





