Contents tagged with Silverlight 4
-
MVVM, Data Channel, MEF, WCF RIA Services and ViewModel Locator – Silverlight 4.0
In the Aspen project I decided to use a ViewModel locator to find the ViewModel a View should use, I also use MEF for composition of parts. In this post I’m going to write about the MVVM implementation we use in the Aspen project, but first about the Data Channel used in Aspen.
-
The Aspen progress – Silverlight 4, Net 4, WCF RIA Services ref. project
It was a while since I wrote a blog post, the reason are many, first preparation for the SDC2010 conference where I talked about WCF RIA Services, then 2 sessions at Microsoft TechDays 2010 where I talked about Web Form vs MVC and building business application with Silverlight 4, MVVM and WCF RIA Services.. and then bought a new car and also have bean on the Microsoft Visual Studio 2010 Ultimate tour and one week vacation in Italy. So a busy time. This blog post will only mention some of the latest updates we have made to the project.
-
Aspen – A sample app using Silverlight 4 and .Net 4.0 – part 2 of X – MEF and EF 4 code-only
Note: The code examples in this blog post will be based on technical previews and betas of .Net 4.0 and VS2010. So changes can be made before it hits RTM.
-
Aspen – A sample app using Silverlight 4 and .Net 4.0 – part 1 of X
Together with Dag König and Danwei Tran at Microsoft, I’m building an app with the code name “Aspen”. This application will use most of the new features shipped with Visual Studio 2010, such as, Silverlight 4, Entity Framework 4, MEF, WCF RIA Services etc. We are going to use the MVVM pattern and a sort of Domain Driven Design (DDD) approach. Danwei is the GUI designer, she will use Sketchflow and Expression Blend 4. Dag König is the “Standards authority” and will also do some development. My part is to be a developer, both backend and client-side. I will blog about our progress on my blog and that is the reason for the X in the title of this blog post. I don’t know how many parts it will be ;)
-
Silverlight – About validation when binding to custom forms – Part 2 using Silverlight 4
In my first part about validation and binding to custom forms I wrote about how we could with some small hack enable the Validation Tooltip for a bounded control manually when we press a button. In this post I will instead use Silverlight 4 with Commanding and the INotifyDataErrorInfo interface to “manually” show the validation tooltip for a specific control.
-
Silverlight 4 - Make Commanding use lesser code
In my previous post about using Silverlight 4 Commanding, I got a question why I didn’t use delegates etc instead of creating a lot of ICommand classes. In this post I’m going to show how you can reduce the number of ICommand classes.
-
Silverlight 4 - MVVM with Commanding and WCF RIA Services
Note: The code example in this post uses Silverlight 4 PDC Beta and WCR RIA Services PDC Beta, so some changes can be made before RTM.
-
Using the WebBrowser control and debug a Silverlight Out-of-browser (OOB) application in VS 2010
Yesterday I played with the WebBrowser control shipped with Silverlight 4. I was trying to create a little RSS Reader for Silverlight 4, only to try out some of the new features. The WebBrowser control have two methods to display a web page, the Navigate and the NavigateToString. The Navigate takes an URI, the NavigateToString takes a string with for example HTML to be diplsyed inside of the WebBrowser window. In my case I didn’t want to use the Navigate, instead the NavigateToString so I could just grab some RSS feeds and get the body of a post and pass it to the WebBrowser control. First of all I notice that the WebBrowser control will only work in a Out-of-browser application, if we try to use it in a browser we will se the following:
-
Silverlight 4 and Asynchronous Validation with INotifyDataErrorInfo
During this week I helped a company with the design of a RIA with Silverlight. In the existing Web and Window Forms application they have a form where the users can enter an account id (or was it a customer id ;)). When they leave the TextBox they did a check if the account id already exists or not. They use their own way of showing the validation message. Now in the new application they want to use the red boxes showed up in Silverlight when a validation fails. In Silverlight 3 the validation only showed up if the bounded property of a TextBox thrown an exception in the set method. It’s not easy to manually trigger the nice red validation message box for a specific control outside the set method of a bounded property. Every call to the service layer from the Client should be asynchronous and in that way the callback can’t trigger the validation error box. With Silverlight 4 it’s now possible to notify when a validation fails when an async. method is completed. This is thanks to the INotifyDataErrorInfo interface. This interface can be used to notify the UI when an validation fails, and that can be done outside the set method of a property, for example in a async. callback method. The INotifyDataErrorInfo has the following members:
-
Silverlight 4 Commanding enables ViewModels
One feature out of many really great feature shipped with Silverlight 4 Beta, is Commanding. With Commanding we can use the MVVM (Model View View Model) Pattern. Commanding is something that WPF has and preview Silverlight doesn’t. Commanding can only be used on ButtonBase controls and Hyperlink control at the moment, and will only be executed by the Click event. In this post I’m going to show how you can use the new Commanding feature and create use the MVVM pattern in Silverlight 4. Here is my simple UI: