You will start adding a new Silverlight 4 application project to your solution. To do this, right click on the ContosoAutomotive solution node and selecting | In the Add New Add New project. Project dialog, select Silverlight Application as the project type and enter ContosoAutomotive.Silverlight in the project name field. Figure Adding Silverlight 4 project (C#) Figure Adding Silverlight 4 project (Visual Basic) In the New Silverlight Application options dialog accept all defaults. Ensure Silverlight 4 is selected in the Silverlight Version list. Figure New Silverlight Application options dialog Copy all the images files from the ContosoAutomotive WPF project into the Silverlight version. To do this, right click on the Images folder in the ContosoAutomotive project and select Copy. Then, right click the ContosoAutomotive.Silverlight project and select Paste. Add a reference to the MEF library on the ContosoAutomotive.Silverlight project. You will include the Initialization assembly as well. To do this: Select the ContosoAutomotive.Silverlight project in the Solution Explorer and select Project | Add Reference… The Add References dialog appears. Select the .NET tab and then select the System.ComponentModel.Composition and the System.ComponentModel.Composition.Initialization components. the OK button to add these references to the project. Figure 1 Add a Reference to the MEF library. Add a reference to the System.Windows.Controls.Data and System.Windows.Controls.Data.Input on the ContosoAutomotive.Silverlight project. The Cash Maker UI will use these libraries to show data. To do this:
You will start adding a new Silverlight 4 application project to your solution. To do this, right click on the ContosoAutomotive solution node and selecting Add | New project. In the Add New Project dialog, select Silverlight Application as the project type and enter ContosoAutomotive.Silverlight in the project name field. Figure Adding Silverlight 4 project (C#) Figure Adding Silverlight 4 project (Visual Basic) In the New Silverlight Application options dialog accept all defaults. Ensure Silverlight 4 is selected in the Silverlight Version list. Figure New Silverlight Application options dialog Copy all the images files from the ContosoAutomotive WPF project into the Silverlight version. To do this, right click on the Images folder in the ContosoAutomotive project and select Copy. Then, right click the ContosoAutomotive.Silverlight project and select Paste. Add a reference to the MEF library on the ContosoAutomotive.Silverlight project. You will include the Initialization assembly as well. To do this: Select the ContosoAutomotive.Silverlight project in the Solution Explorer and select Project | Add Reference… The Add References dialog appears. Select the .NET tab and then select the System.ComponentModel.Composition and the System.ComponentModel.Composition.Initialization components. the OK button to add these references to the project. Figure 1 Add a Reference to the MEF library. Add a reference to the System.Windows.Controls.Data and System.Windows.Controls.Data.Input on the ContosoAutomotive.Silverlight project. The Cash Maker UI will use these libraries to show data. To do this:
IntroToMEF.docx