Using the Silverlight Business Application Template
Till Day 4, we have discussed various primary but important aspect of WCF RIA Service and Domain Service class. Today we will learn creating of WCF RIA Solution using Silverlight Business Application template. You will get Silverlight Business Application template installed under the Silverlight tab as below,
Go ahead and create Silverlight project choosing Silverlight Business Application template. After successful creation of the project run the Silverlight without amending anything in the solution. You will notice at output you are getting a default screen with options of different views like Home, About and Login
Closely examine Silverlight project in solution explorer and you will find different folders like View, Model etc.
If you want to add new page in the business application, very first you need to add Silverlight page in the View Folder. I have added a Silverlight page named MyLearning.xaml in the View folder as below,
After adding page you need to add link on the MainPage.xaml to navigate to this page from home page. For that open MainPage.xaml and inside URI mapper add a mapping for MyLearning.xaml.
MainPage.Xaml
Once you have added URI mapping add a link on the main grid of MainPage.xaml as below,
MainPage.Xaml
Above we are binding content of hyper link with resource from Application resources. Now go ahead and add an entry for MyLearningPageTitle in ApplicationStrings.rescx file
ApplicationStrings.rescx
After adding entry if you run application, you will get a link at home page to navigate to newly added xaml as below,
If click on login link then application will prompt you for authentication.
You can create a new user as well on clicking on Register Now Link. There is default validation implemented as well. If you violate the validation you will get prompt error message as below,
On clicking button a new user will get created.
There are many things and features of Business Application Template are yet to be covered. Today we just touched the basic that would help you to start and explore more on this template.
See on Day 6
Leave a Reply