Archive for ◊ January, 2011 ◊

Author:
Friday, January 28th, 2011

Using Linq we can create the xml document very easily. This document explains as to how we can create the xml document using Linq.

Let’s create a simple xml document which has customer details and order details for each customer. For this we need to have the customer’s collection which contains the required data to create the xml. Create the required customer class and the order class as shown below.

    public class Customers    {

        public int Id { get; set; }

        public string Name {get; set;}

        public string Phone { get; set; }

        public string Email { get; set; }

        public List<Orders> Orders {get; set;}

    }

     public class Orders    {

        public string OrderName { get; set; }

        public int Quantity { get; set; }

        public string Date { get; set; }

           }

Then we create the Customers collection as shown below.

List<Customers> customers = new List<Customers>()            {

                New Customers(){Id=1,Name=”Customer1″,Phone=”9845884650″, Email=”Customer1@gmail.com”,

                Orders=new List<Orders>()                {

                    New Orders(){ Date=DateTime.Today.ToShortDateString(), OrderName=”OrderName1″, Quantity=2},

                    New Orders(){Date=DateTime.Today.AddDays(1).ToShortDateString(), OrderName=”OrderName2″, Quantity=3},

                    new Orders(){Date=DateTime.Today.AddDays(2).ToShortDateString(), OrderName=”OrderName3″, Quantity=4},

                }},

                new Customers(){Id=2,Name=”Customer2″,Phone=”9845884651″, Email=”Customer2@gmail.com”,

                Orders=new List<Orders>()                {

                    new Orders(){Date=DateTime.Today.AddDays(3).ToShortDateString(), OrderName=”OrderName1″, Quantity=5},

                    new Orders(){Date=DateTime.Today.AddDays(4).ToShortDateString(), OrderName=”OrderName2″, Quantity=6},

                    new Orders(){Date=DateTime.Today.AddDays(5).ToShortDateString(), OrderName=”OrderName3″, Quantity=7},

                }},

                new Customers(){Id=3,Name=”Customer3″,Phone=”9845884652″, Email=”Customer3@gmail.com”,

                Orders=new List<Orders>()               {

                    new Orders(){Date=DateTime.Today.AddDays(6).ToShortDateString(), OrderName=”OrderName1″, Quantity=8},

                    new Orders(){Date=DateTime.Today.AddDays(7).ToShortDateString(), OrderName=”OrderName2″, Quantity=9},

                    new Orders(){Date=DateTime.Today.AddDays(8).ToShortDateString(), OrderName=”OrderName3″, Quantity=10},

                }}

            };

Once we have the customers collection, then to create the xml document we create the root XElement first and then query the customers collection and foreach customer collection we add a new Child xelement as shown below.

// The root element

XElement xelement = new XElement(“Customers”,

from customer in customers

// Adding each customer info as the child element

select new XElement(“Customer”,

new XAttribute(“ID”, customer.Id),

new XAttribute(“Email” ,customer.Email),

new XElement(“Name”, customer.Name),

new XElement(“Phone”, customer.Phone),

// Each customer can have more then one orders, so querying the orders collection and adding the exisitng order details

from order in customer.Orders

select new XElement(“Order”,

new XAttribute(“OrderDate”, order.Date),    

new XElement(“OrderName”, order.OrderName),                                          

new XElement(“OrderQuantity”, order.Quantity))));

                             

 

The generate xml document wil be as shown below

 

<Customers>

  <Customer Email=”Customer1@gmail.com”>

    <Name>Customer1</Name>

    <Phone>9845884650</Phone>

    <Order OrderDate=”8/2/2010″>

      <OrderName>OrderName1</OrderName>

      <OrderQuantity>2</OrderQuantity>

    </Order>

    <Order OrderDate=”8/3/2010″>

      <OrderName>OrderName2</OrderName>

      <OrderQuantity>3</OrderQuantity>

    </Order>

    <Order OrderDate=”8/4/2010″>

      <OrderName>OrderName3</OrderName>

      <OrderQuantity>4</OrderQuantity>

    </Order>

  </Customer>

  <Customer Email=”Customer2@gmail.com”>

    <Name>Customer2</Name>

    <Phone>9845884651</Phone>

    <Order OrderDate=”8/5/2010″>

      <OrderName>OrderName1</OrderName>

      <OrderQuantity>5</OrderQuantity>

    </Order>

    <Order OrderDate=”8/6/2010″>

      <OrderName>OrderName2</OrderName>

      <OrderQuantity>6</OrderQuantity>

    </Order>

    <Order OrderDate=”8/7/2010″>

      <OrderName>OrderName3</OrderName>

      <OrderQuantity>7</OrderQuantity>

    </Order>

  </Customer>

  <Customer Email=”Customer3@gmail.com”>

    <Name>Customer3</Name>

    <Phone>9845884652</Phone>

    <Order OrderDate=”8/8/2010″>

      <OrderName>OrderName1</OrderName>

      <OrderQuantity>8</OrderQuantity>

    </Order>

    <Order OrderDate=”8/9/2010″>

      <OrderName>OrderName2</OrderName>

      <OrderQuantity>9</OrderQuantity>

    </Order>

    <Order OrderDate=”8/10/2010″>

      <OrderName>OrderName3</OrderName>

      <OrderQuantity>10</OrderQuantity>

    </Order>

  </Customer>

</Customers>

Category: .Net  | One Comment
Author:
Thursday, January 27th, 2011

The common units which we use in web are

Absolute Units

  • pixels (px)
  • points (pt)
  • picas (pc)
  • inches (in)
  • centimeters (cm)
  • millimeters (mm)

Relative Units

  • em units (em)
  • ex units (ex)

Suppose I create my web page with absolute units for example “px”, then web page’s look and feel will vary in different output devices with different resolutions. Now a days we are able to view websites in Mobile, Laptops with high resolutions and monitors with different resolution. If I fix my website width & height as 770px X 450px, then it will look very small in high resolution monitor.

In a scenario where I have a div with width 200px & height 100px, inside div I have kept a paragraph content with font-size 11px.For some users who  can’t read small letters, they increase the default font-size of the browser, in that case the font-size of the paragraph won’t change since we gave the fixed 11 px as font size.

To achieve this we need to use relative unit “em”. With the help of “em” we can create flexible layouts. “em” takes the font size of the outer container and make percentage of that.

For eg:

If

body { font-size:10px; }

then

1 “em” = 10 px

0.5 “em” = 5 px

2 “em” = 20 px

If you dont mention outer container css, then it takes the default browser font size which is 16 px in most of the popular browsers. Now, we  allow our visitors to control our layout. If they increase or decrease the default font-size of the browser, our layout will become so flexible that it gives them the view of their need.

Some top sites which uses em are

http://www.php.net

http://www.microsoft.com

http://www.ibm.com

All the above websites are so flexible; they will adjust to the default browser font size.

But most of the websites uses absolute units eg http://www.w3schools.com, it won’t adjust to default browser’s font size.

So Guys, it’s good to choose “em” as our unit for web pages to give our visitors user friendly web pages.

Example Here

Author:
Thursday, January 20th, 2011
analyze your source code according to the following quality axes :
Respect of coding rules violations
Density of documented API
Density of duplicated Code
Level of code coverage by Unit Tests
Density of potential bugs
Complexity distribution

Sonar analyzes your source code according to the following quality axes :

Respect of coding rules violations

Density of documented API

Density of duplicated Code

Level of code coverage by Unit Tests

Density of potential bugs

Complexity distribution

Sonar drives many tools including among others :

  • Static analysis : Checkstyle, PMD/CPD, Findbugs, JavaNCSS.
  • Dynamic analysis for unit tests : Cobertura, Clover, Surefire.

Sonar Requirements

Sonar runs on any operating system that supports Java and Maven. Those two pieces of software need to be installed first:

Sonar requires a relational database for storage of measures data. Sonar supports :

  • It is recommended to create an UTF-8 database named ‘sonar’ accessed by specific user ‘sonar’. Here is an example with MySQL:

mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;

mysql> grant all privileges on sonar.\* to ‘sonar’@'localhost’ identified by ‘\[your password\]‘;

mysql> flush privileges;

Sonar Installations

  • Download and Unzip the distribution
  • Execute on windows

bin\windows-x86-32\StartSonar.bat

  • If you do not use the default embedded database, edit conf/sonar.properties to configure the database access. Templates are available for every supported database. Just uncomment them and comment the first four lines dedicated to derby.

* sonar.jdbc.url : the URL of the database

* sonar.jdbc.driver : the class of the driver

* sonar.jdbc.user : the username (default is ‘sonar’)

* sonar.jdbc.password : the password (default is ‘sonar’)

Example for MySQL :

#sonar.jdbc.url: jdbc:derby://localhost:1527/sonar;create=true

#sonar.jdbc.driver: org.apache.derby.jdbc.ClientDriver

#sonar.jdbc.defaultTransactionIsolation: 1

#sonar.jdbc.validationQuery: values(1)

sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8

sonar.jdbc.driver: com.mysql.jdbc.Driver

sonar.jdbc.validationQuery: select 1

Install and Configure Sonar plugin on Hudson

Click on Manage Hudson – Manage Plugins. Click now on the Available tab, you should see the Hudson Sonar Plugin. Check this plugin and click on the Install button at the far right hand corner.

Restart Hudson and you should be able to see the plugin in the Installed tab as shown below:

Image 1

Next, configure the Sonar plugin from within Manage Hudson -> Configure System. I am using the default database, and so didn’t make any changes here. However, if you are using a different database server, you need to provide the database URL, username, password and so on as shown below.

sonar_2

more…

Wednesday, January 19th, 2011

In my previous post Silverlight, PRISM, MVVM, MEF – Part 3, I explained how to add validation metadata to entities and perform data validation on views in the prism application. The standard validation attributes that ship in the System.ComponentModel.DataAnnotations assembly can cover many common validation scenarios. But if you want to do perform custom validations on the business logic, you need to use the CustomValidationAttribute to implement the validation logic. Like the standard validation attributes, it also allows you to specify an ErrorMessage and the properties that failed the validation.

Custom validations can be implemented in a separate class which has static methods that perform the validation. For e.g

[MetadataTypeAttribute(typeof(Customer.CustomerMetadata))]

public partial class Customer

{

[CustomValidation(typeof(CustomerRules), "ValidateCustomer")]

internal sealed class CustomerMetadata

{

private CustomerMetadata()

{

}

[CustomValidation(typeof(CustomerRules), "IsValidJoiningDate")]

public DateTime? DateOfJoining { get; set; }

}

}

The above sample code has custom validations implemented on entity and property level. The validation rules are implemented in the CustomerRules class which is shared between the server and the client.

public class CustomerRules

{

public static ValidationResult ValidateCustomer(Customer customer, ValidationContext context)

{

if (string.Compare(customer.FirstName, customer.LastName, StringComparison.OrdinalIgnoreCase) == 0)

return new ValidationResult(“First name and last name cannot be same”, new string[] { “FirstName”, “LastName” });

return ValidationResult.Success;

}

public static ValidationResult IsValidJoiningDate(DateTime? joiningDate, ValidationContext context)

{

if (joiningDate.HasValue)

{

if(joiningDate.Value.Year < 1990 || joiningDate.Value.Year > 2011)

return new ValidationResult(“Joining date should be between 01-01-1990 && 31-12-2011″, new string[] { “DateOfJoining”});

}

return ValidationResult.Success;

}

}

In the client code XAML, you just need to set the NotifyOnValidationError property to True to notify the user on validation errors

<TextBox Text=”{Binding CurrentCustomer.FirstName, Mode=TwoWay, NotifyOnValidationError=True}” Grid.Column=”1″ Grid.Row=”2″ Width=”250″ Height=”25″ HorizontalAlignment=”Left” />

<TextBox Text=”{Binding CurrentCustomer.LastName, Mode=TwoWay, NotifyOnValidationError=True}” Grid.Column=”3″ Width=”250″ Height=”25″ HorizontalAlignment=”Left” Grid.Row=”3″ />

<Button Grid.Row=”4″ Content=”Add” prism:Click.Command=”{Binding AddCustomerCommand}” Width=”120″ HorizontalAlignment=”Right” />

<telerik:RadGridView HorizontalAlignment=”Left” Grid.ColumnSpan=”2″ Name=”radGridView1″ VerticalAlignment=”Top” ItemsSource=”{Binding Customers}” SelectedItem=”{Binding CurrentCustomer, Mode=TwoWay}” AutoGenerateColumns=”False”>

<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn DataMemberBinding=”{Binding Id, NotifyOnValidationError=True, Mode=TwoWay}” IsReadOnly=”True” Header=”Customer ID” Width=”100″ />

<telerik:GridViewDataColumn DataMemberBinding=”{Binding FirstName, NotifyOnValidationError=True, Mode=TwoWay}” Header=”First Name” Width=”200″ />

<telerik:GridViewDataColumn DataMemberBinding=”{Binding LastName, NotifyOnValidationError=True, Mode=TwoWay}” Header=”Last Name” Width=”200″ />

<telerik:GridViewDataColumn DataMemberBinding=”{Binding DateOfJoining, NotifyOnValidationError=True, Mode=TwoWay}” Header=”Joined On” Width=”200″ />

</telerik:RadGridView.Columns>

</telerik:RadGridView>

Output

CustomValidation-PrismRIAMVVM

Category: .Net, Silverlight | Tags: , , ,  | 2 Comments
Saturday, January 15th, 2011

Your view model or model will often be required to perform data validation and to signal any data validation errors to the view so that the user can act to correct them.

Silverlight and WPF provide support for managing data validation errors that occur when changing individual properties that are bound to controls in the view. For single properties that are data-bound to a control, the view model or model can signal a data validation error within the property setter by rejecting an incoming bad value and throwing an exception. If the ValidatesOnExceptions property on the data binding is true, the data binding engine in WPF and Silverlight will handle the exception and display a visual cue to the user that there is a data validation error.

However, throwing exceptions with properties in this way should be avoided where possible. An alternative approach is to implement the IDataErrorInfo or INotifyDataErrorInfo interfaces on your view model or model classes. These interfaces allow your view model or model to perform data validation for one or more property values and to return an error message to the view so that the user can be notified of the error.

If you are using WCF RIA services for your silverlight application, the rich built-in support for the validation attributes in the System.ComponentModel.DataAnnotation namespace can be used to implement the validation rules via attributes. Just by having that attribute on the server entity or its metadata class, it shows up on the code generated client entity. Additionally, the WCF RIA Services Entity base class that is added to the client entity has an implementation of INotifyDataErrorInfo that uses the data annotation attributes to perform validation when data bound in the UI. So just by adding these attributes with appropriate error messages, you get validation indications for the user in the UI.

The validation attributes in the System.ComponentModel.DataAnnotation namespace include the ability to specify simple forms of validation on entity properties by adding an attribute to an entity property. For e.g.  The below sample shows data validations applied on the Customer entity.

[MetadataTypeAttribute(typeof(Customer.CustomerMetadata))]

public partial class Customer

{

internal sealed class CustomerMetadata

{

private CustomerMetadata()

{

}

[Required(ErrorMessage="FirstName should be provided")]

[StringLength(100, ErrorMessage="FirstName max length is 100")]

public string FirstName { get; set; }

[Key]

[Required]

public int Id { get; set; }

[Required(ErrorMessage = "LastName should be provided")]

[StringLength(100, ErrorMessage = "LastName max length is 100")]

public string LastName { get; set; }

[Range(typeof(DateTime), "01/01/1990", "01/01/2011", ErrorMessage="Date of joining should be in the range 01-01-1990 - 01-01-2011")]

public Nullable<DateTime> DateOfJoining { get; set; }

public EntityCollection<Order> Orders { get; set; }

}

}

The XAML code looks like.

<StackPanel Orientation=”Vertical”>

<telerik:RadGridView AutoGenerateColumns=”False” ItemsSource=”{Binding Customers}” SelectedItem=”{Binding CurrentCustomer, Mode=TwoWay}”  HorizontalAlignment=”Left” Margin=”0 20 0 0″>

<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn DataMemberBinding=”{Binding FirstName}” Header=”First Name” Width=”200″ />

<telerik:GridViewDataColumn DataMemberBinding=”{Binding LastName}” Header=”Last Name” Width=”200″/>

<gridViewColumns:DateTimePickerColumn DataMemberBinding=”{Binding DateOfJoining}” Header=”DOJ” Width=”150″ />

</telerik:RadGridView.Columns>

</telerik:RadGridView>

<Grid x:Name=”LayoutRoot” Background=”White”>

<Grid.Resources>

<Style x:Key=”TextBlockStyle” TargetType=”TextBlock” >

<Setter Property=”HorizontalAlignment” Value=”Right” />

<Setter Property=”VerticalAlignment” Value=”Center” />

<Setter Property=”Height” Value=”25″ />

<Setter Property=”Margin” Value=”0 0 10 0″ />

<Setter Property=”FontSize” Value=”14″ />

</Style>

</Grid.Resources>

<Grid.RowDefinitions>

<RowDefinition Height=”35″ />

<RowDefinition Height=”35″ />

<RowDefinition Height=”35″ />

<RowDefinition Height=”35″ />

</Grid.RowDefinitions>

<Grid.ColumnDefinitions>

<ColumnDefinition Width=”250″ />

<ColumnDefinition Width=”*” />

</Grid.ColumnDefinitions>

<TextBlock Text=”First Name” Style=”{StaticResource TextBlockStyle}” />

<TextBlock Text=”Last Name” Style=”{StaticResource TextBlockStyle}” Grid.Row=”1″ />

<TextBlock Text=”Date Of Joining” Style=”{StaticResource TextBlockStyle}” Grid.Row=”2″ />

<TextBox Text=”{Binding CurrentCustomer.FirstName, Mode=TwoWay, NotifyOnValidationError=True}” Grid.Column=”1″ Width=”250″ HorizontalAlignment=”Left” VerticalAlignment=”Center” Height=”25″ />

<TextBox Text=”{Binding CurrentCustomer.LastName, Mode=TwoWay, NotifyOnValidationError=True}” Grid.Column=”1″ Grid.Row=”1″ Width=”250″ HorizontalAlignment=”Left” VerticalAlignment=”Center” Height=”25″ />

<TextBox Text=”{Binding CurrentCustomer.LastName, Mode=TwoWay, NotifyOnValidationError=True}” Grid.Column=”1″ Grid.Row=”1″ Width=”250″ HorizontalAlignment=”Left” VerticalAlignment=”Center” Height=”25″ />

<Button Content=”Update” Width=”100″ Height=”25″ Grid.Row=”3″ HorizontalAlignment=”Right” prism:Click.Command=”{Binding UpdateCustomerCommand}” />

<telerik:RadDatePicker Grid.Column=”1″ Grid.Row=”2″ HorizontalAlignment=”Left” VerticalAlignment=”Center” SelectedValue=”{Binding CurrentCustomer.DateOfJoining, Mode=TwoWay, NotifyOnValidationError=True}” />

</Grid>

</StackPanel>

ViewModel implementation

[Export(typeof(CustomerViewModel))]

[PartCreationPolicy(CreationPolicy.NonShared)]

public class CustomerViewModel : NotificationObject

{

public ObservableCollection<Customer> Customers { get; set; }

public Customer CurrentCustomer

{

get { return _customer; }

set

{

_customer = value;

RaisePropertyChanged(“CurrentCustomer”);

}

}

[ImportingConstructor]

public CustomerViewModel(ICustomerRepository repository)

{

_customerRepository = repository;

Customers = new ObservableCollection<Customer>();

WireEvents();

LoadCustomers();

}

private void WireEvents()

{

_customerRepository.OnCustomersLoaded += new EventHandler<EventArgs<IEnumerable<Customer>>>((x, y) =>

{

foreach (var customer in y.Data) Customers.Add(customer);

});

}

private void LoadCustomers()

{

_customerRepository.GetAll();

}

}

When invalid data is entered in the view, you can see the validation errors on the properties as in the figure below.

Prism3_sample

Category: .Net, Silverlight | Tags: , ,  | One Comment
Friday, January 07th, 2011

Actions or operations that can be performed in the view model are implemented as commands.  Commands provide a convenient way to represent actions or operations that can be easily bound to controls in the UI. They encapsulate the actual code that implements the action or operation and help to keep it decoupled from its actual visual representation in the view.

Commands are implemented in the ViewModel either as CommandMethods or ICommand implementations.  The ICommand objects defines an Execute and CanExecute method which encapsulate the action logic. Prism has a DelegateCommand implementation which implements the ICommand interface. The DelegateCommand’s constructor allows you to define the delegates for the Execute and CanExecute actions.  For e.g the XAML given below shows a button that is bound to a DelegateCommand.

<StackPanel Orientation=”Horizontal” Grid.Row=”1″ HorizontalAlignment=”Right” Margin=”0 15 0 0″>

<TextBlock Text=”Search text: ” VerticalAlignment=”Center” />

<TextBox Width=”240″ Text=”{Binding SearchText, Mode=TwoWay}” />

<Button Content=”Search” prism:Click.Command=”{Binding SearchCommand}” />

</StackPanel>

Namespace implementations

xmlns:prism=”http://www.codeplex.com/prism”

You can also pass command parameters using the CommandParameter property.

In the view model the SearchCommand implementation is defined as

[Export]

[PartCreationPolicy(CreationPolicy.NonShared)]

public class EmployeeViewModel : NotificationObject

{

[ImportingConstructor]

public EmployeeViewModel(IEmployeeRepository employeeRepository)

{

_employeeRepository = employeeRepository;

GetEmployees();

SetCommands();

PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler((x, y) => RaiseCommandChangedEvent());

}

private void RaiseCommandChangedEvent()

{

SearchCommand.RaiseCanExecuteChanged();

}

private void SetCommands()

{

SearchCommand = new DelegateCommand(() => FilterEmployees(), () => !string.IsNullOrEmpty(SearchText));

}

public DelegateCommand SearchCommand { get; private set; }

private void FilterEmployees()

{

//Filter employees here…

}

//Rest of the code…

}

Tuesday, January 04th, 2011

The Model-View-ViewModel (MVVM) pattern helps you to cleanly separate the business and presentation logic of your application from its user interface (UI). The MVVM pattern helps you separate the presentation and business logic to be put into 3 main classes, VIEW, VIEW MODEL and MODEL.

In this post we’ll see the implementation of MVVM in prism using MEF for View and ViewModel discovery.  The class interactions used in this sample is as given below.

MVVM

The model class in the sample contains data for the Employee object

public class Employee : BaseEntity

{

public string FirstName { get; set; }

public string LastName { get; set; }

public DateTime DateOfJoining { get; set; }

public string Designation { get; set; }

}
The EmployeeRepository class is used to query data about employees.

[Export(typeof(IEmployeeRepository))]

public class EmployeeRepository : Repository<Employee>, IEmployeeRepository

{

public override System.Collections.Generic.IEnumerable<Employee> All()

{

return _context.Employees;

}

public override void Save(Employee entity)

{

//Save method

}

public override void Remove(Employee entity)

{

//Remove logic

}

}

The repository instance will be resolved in the ViewModel class via the Import attribute.

[ImportingConstructor]

public EmployeeViewModel(IEmployeeRepository employeeRepository)

{

_employeeRepository = employeeRepository;

GetEmployees();

}

Implementing the View and ViewModel classes

[Export]

[PartCreationPolicy(CreationPolicy.NonShared)]

public class EmployeeViewModel : NotificationObject

{

[ImportingConstructor]

public EmployeeViewModel(IEmployeeRepository employeeRepository)

{

_employeeRepository = employeeRepository;

GetEmployees();

}

private void GetEmployees()

{

Employees = new ObservableCollection<Model.Employee>(_employeeRepository.All());

}

public ObservableCollection<Model.Employee> Employees { get; set; }

IEmployeeRepository _employeeRepository;

}

The ViewModel instance is resolved in the view the same way.

[Export]

[PartCreationPolicy(CreationPolicy.NonShared)]

public partial class EmployeeView : UserControl

{

[Import]

public EmployeeViewModel ViewModel

{

set { DataContext = value; }

}

public EmployeeView()

{

InitializeComponent();

}

}

The NonShared enumeration makes sure that singleton instance of view is not created. Now in the module controller class you can resolve this view instance and show it in the respective region when required. My code sample looks like.

[Import]

public EmployeeView EmployeeView { get; set; }

[ImportingConstructor]

public EmployeeModule(IRegionManager regionManager)

{

_regionManager = regionManager;

}

private void OnSearchAndViewClicked()

{

_regionManager.AddToRegion(“MainRegion”, EmployeeView);

_regionManager.Regions["MainRegion"].Activate(EmployeeView);

}

Final output

PrismMVVM_1

Next we’ll see how to implement commands and interactions between View and ViewModel via ICommand implementation.

Category: .Net, Silverlight | Tags: , ,  | One Comment