Resharper is an amazing tool for any .Net developers. The latest version 6.1 has been released just a couple of weeks ago and I wanted to share with you a brief overview of the new workflow available in the XAML world !
Visual Studio 2010 introduced 2 new design time properties: d:DesignInstance and d:DesignData. Those properties can be used in order to specify a design time DataContext in order to have more help during the creation of a binding.
For example, when you create a binding using the Property dialog of VS2010 you can browse your DataContext to select the right property (image from this blog post from Karl Shifflet):
Resharper 6.1 is now able to use those metadata in order to improve the experience you have while typing XAML (which I personally do a LOT!). Here is how it works:
- you create a new ViewModel with a simple property (this property has just get/set because we don’t need much more in the context of this post…)
- you setup a binding in your view
At this point the ReSharper magic comes into play…
- ReSharper warns you the DataContext is unknown
- Offer the ability to fix this
- Note that like in C#, you can very easily resolve namespace issues
- Then notice that the warning is gone (the Title property is no longer underlined)
- You can now add a new binding
- You can then ask ReSharper to create the property in your ViewModel
- Choosing the first option will get you to the ViewModel definition
Now that I’ve upgraded my installation to version 6.1, I think this is a must have !
That’s all for today ! Hope it helps 🙂
Next Wednesday (November 9th), I’ll be at the Microsoft Days 11 as a member of the Ask The Expert team. I’ll be playing with the Samsung Slate I got at //BUILD/, discussing WPF, Silverlight, Windows Phone 7 and Windows 8.
Don’t hesitate to stop by and say hi if you’re coming to this event !
This blog post is part of my BUILD series.
I’m having a very busy week here in Anaheim ! I’m meeting many new people and had the chance to enjoy the conference from the inside. I’m also playing with this new Windows 8 slate Microsoft gave us ! I’m not going to do a blog post trying to summarize everything because there is just so much to say.I’m going to try to share my point of view on what I’ve seen here.
Our new platform
The original picture shown during the keynote to introduce the new platform was this one:
There has been a lot of confusion about that because of having XAML with C# in the Metro Style Apps without any reference to the CLR… Doug Steven did a pretty great job (blog post is here) by discussing with key people from the engineering team of Microsoft and creates this new more accurate picture:
Here is a quick summary:
- there is only one CLR
- .Net framework 4.5 is used in both Metro apps and Classic apps
- it’s the same MSIL for Metro apps and Classic apps
- in the Metro platform, we have a subset of the .Net framework (for example no OpenFileDialog…)
Before //BUILD we had already many choices to choose our development environment. we now have even more:
- WPF and managed code for classic desktop apps
- Silverlight in a web environment
- Silverlight out of browser
- WinRT + XAML for Metro apps
- WinRT + HTML for Metro apps
I personally think that Silverlight in a web browser has not a great future. Microsoft just announced for example that the immersive version of IE will not run any plugins (so no Silverlight in the Metro UI) and we ‘ll know Microsoft is pushing HTML5 very strongly.
For classic desktop apps we have 2 options: WPF and Silverlight. Each of them has advantages and the choice we’ll have to do will depend on our constraints (deployment, business needs, connectivity…). I think there is room for the 2 platforms there.
For the Metro UI, you can choose between XAML and HTML. Microsoft told us they will keep a good feature parity between the 2 options. If you choose XAML and managed code you’ll be able to leverage a subset of the .Net framework.
I think another important aspect is that Metro will be available on Windows 8 only. Even though this new version of the OS might have a fast deployment rate (thanks to the slates), in many companies I don’t think it will be that fast.This, plus the fact that some LOB apps will not benefit the Metro UI leaves a lot of work to do in the desktop applications world (where we have both WPF and SL)… For WPF, we now have a new version coming in .Net 4.5. You can check out the new stuff here in the documentation.
In my next blog post I’m going to try to go deeper in the new WinRT/XAML world and see how it looks like for us, WPF and Silverlight developers.