RIA 1.0
AA We need…. We need….. BBCC RIA 1.0 We need….. DDEEFFGGHHIIJJKK We need….
The Managed Extensibility Framework (MEF) is a new library in Silverlight 4 for building applications that can be incrementally extended. > For customers > For you and your team > Always there, always ready
Demo
Widget1 [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export
Widget1 [Export(typeof(UserControl))] public class Widget1 : UserControl { [Import] public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Import
Widget1 [Export(typeof(UserControl))] public class Widget1 : UserControl { [Import(“HelloMEF.Message”)] public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Import
Main Page [Export(typeof(UserControl))] public class MainPage: UserControl { [ImportMany(typeof(UserControl))] public IEnumerable { get;set; } ImportMany
Compose it. PartIntializer: “Compose yourself” Main Page Compose public MainPage() { InitializeComponent(); PartInitializer.SatisfyImports(this); }
Widget1 [ExportMetadata(“Location”,Location.Top)] [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export
Main Page [Export(typeof(UserControl))] public class MainPage: UserControl { [ImportMany(typeof(UserControl))] public IEnumerable { get;set; } ImportMany
Widget1 [ExportMetadata(“Location”,Location.Top)] [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export
Widget1 [Widget(Location=Location.Top)] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export
Demo
partner
Module Loader
partner
Built by Developers for Developers….
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.