MEF vs Prism
There is some obvious overlap but also a clear delineation. In particular when it comes to UI composition. MEF can be used for UI composition for sure, however it doesn’t have specific UI composition bits like RegionManager, Composite Commands, EventAggregator.
In general though here are the differences.
- First, MEF is in the platform as part of SL4/FX4.
- Second, MEF is a general UI agnostic composition technology while Prism is specific for UI composition. MEF also extends beyond composite applications to general extensibility / plugin models.
- Third, Prism and MEF can work together.
There are two primary use cases i hear about for MEF and Prism working together.
- Use Prism with MEF as an add-on for extensibility. That is make modules extensible through MEF. You can think of this as the “Two worlds in harmony” solution. Your core architecture rests on Prism’s modularity / and an IoC Container and sits side by side with MEF.
- Use MEF primarily for modularity, and pull in Prism bits for UI composition. In this model, your core architecutre sits on top of MEF, with MEF replacing the services of your IoC.
Via MEF and Prism, to be or not to be. – Glenn Block – CodeBetter.Com – Stuff you need to Code Better!
Sharing Silverlight Assemblies with .NET Apps – Kind of
For SL 4 and .NET 4, the following assemblies are portable at the Siverlight surface area:
- Mscorlib
- System
- System.Core
- System.ComponentModel.Composition
- Microsoft.VisualBasic
There are a great number of types and members in the .NET surface area that cannot run on Silverlight. As a result, you need to write code that targets the Silverlight versions of these assemblies in order to get this scenario to work.
Developers should write their portable logic in Silverlight Class Library projects, and then are free to reference such projects from both Silverlight and .NET application projects. To clarify, on the .NET side, you can reference such a library (Binary) from any kind of .NET project (Ex: WPF, winforms, WCF, WF, ASP.NET, …).
The following are the basic steps to follow to enable the use of portable code in Visual Studio 2010
Steps:
- Setup projects
- Create .NET application
- Create or add existing Silverlight class library project
- Build Silverlight project
- Establish portable code reference
- Reference Silverlight class library binary from the .NET project
- Code
- Run App!
CLR Team Blog : Sharing Silverlight Assemblies with .NET Apps
Adding animation when items are added to the Silverlight Listbox
An enhancement has been made that allows you to add animation when items are added ,or removed from, the list box. Silverlight 4 adds a new StateGroup to the ListBoxItem class:
A Simple Demo
The user types into the text box, clicks the add button and the text “floats” up into the list.
So Where Is the Magic??
To take advantage of the new FluidUI all you need to do is to set the behavior you want on any or all of the three new Visual States in the LayoutStates group of the ListBoxItem class.
The easiest way to do this is to open the project in Blend and right click on the ListBox. Choose Edit Additional Templates –> Edit Generated Item Container –> Edit a Copy
Name the new template and then click on the ListItem and open the
States tab. For this simple demo, only modified the Loaded state.
To do so, click on the Loaded state and then expand the timeline. You’ll set new values for the entire Grid (which has 4 sub-elements).
select 0 seconds, and set the opacity to 0 and the y coordinate of a translate-transform to 200. Click save keyframe values, and then select 1 second and set the opacity to 1 and the y coordinate to 0. Save the new template…
Via Silverlight 4 Fluid UI – Jesse Liberty – Silverlight Geek
Managed Extensibility Framework
Watch this first: 10mins Screencast
In Silverlight 4 – Glenn Block
- PDC09 – Building Extensible RIAs with Managed Extensibility Framework
- MEF has landed in Silverlight 4. We come in the name of extensibility
- Building Hello MEF Part 1
Simple Kick Start Example using MEF (Preview
- Creating the rule Interface : IRule
- Creating a rule instance
- Creating the holder for all your plug-ins
- Creating the logic to load the plugin
- Load Rules at runtime
Also from codeplex:
Read the MEF Programming Guide
Silverlight 4 Sessions for Business Developer
Essential
CL01 – SL4 Overview (Demo files) – Karen Corby
CL21 – Amazing Bus Apps with RIA Services (Demo files)– Brad Abrams
CL19 – Building LOB Apps (Demo files) – David Poll
CL20 – Trusted Apps Out of Browser (Demo files 1, 2) – Joe Stegman
Useful
CL07 – Mastering RIA Services – Dinesh Kulkarni
CL06 – Networking and Web Services in SL4 – Yavor Georgiev
FT24 – Extensible RIA with MEF – Glenn Block
CL22 – Building Large-Scale Apps with Silverlight – John Papa
All about Behaviors
- Mike Taulty
- Shawn Wildemuth
- >Writing Behaviors for Silverlight 3 (Part 1)
- >Writing Behaviors for Silverlight 3 (Part 2)
- Kirupa Chinnathambi
- Christian Schormann
- Pete Blois
Expression Blend 3 Mini-Tutorial Screencasts
-
SketchFlow Part I – Screen, Component, NavigateToScreenAction, ActivateStateAction
-
SketchFlow Part II – Creating, Import, Export Feedback. Generate Word document
-
Sample Data Source – Data Binding (Collection Binding & Element Binding)
-
Blend Behaviors – Demo (Mouse Click, Timer, Gesture, Physics Engine)
Silverlight 4 Rough Notes – Mike Taulty
Mike talks about all the new features found in Silverlight 4
- Silverlight 4 Rough Notes: Trusted Applications
- Silverlight 4 Rough Notes: Camera and Microphone Support
- Silverlight 4 Rough Notes: Printing
- Silverlight 4 Rough Notes: HTML Hosting in the WebBrowser Control
- Silverlight 4 Rough Notes: Notification Windows
- Silverlight 4 Rough Notes: RichTextArea
- Silverlight 4 Rough Notes: Networking
- Silverlight 4 Rough Notes: FlowDirection
- Silverlight 4 Rough Notes: Clipboard Access
- Silverlight 4 Rough Notes: Silverlight as a Drop Target
- Silverlight 4 Rough Notes: Right Mouse Button Support
- Silverlight 4 Rough Notes: Binding
- Silverlight 4 Rough Notes: Binding and IDataErrorInfo
- Silverlight 4 Rough Notes: Binding with INotifyDataErrorInfo
- Silverlight 4 Rough Notes: A Word for Visual Studio 2010
- Silverlight 4 Rough Notes: Styles
- Silverlight 4 Rough Notes: Commanding
- Silverlight 4 Rough Notes: Customising the Window
- Silverlight 4 Rough Notes: Animating Items Into/Out Of ItemsControls
- Silverlight 4 Rough Notes: HTML interop & dynamic language features
- Silverlight 4 Rough Notes: Data Grid Enhancements
- Silverlight 4 Rough Notes: Taking Control of Navigation
- Silverlight 4 Rough Notes: SelectedValue
- Silverlight 4 Rough Notes: Mousewheel Support in Controls
- Silverlight 4 Rough Notes: TextBlock with Trimming
- Silverlight 4 Rough Notes: CompositeTransform
- Silverlight 4 Rough Notes: Viewbox
- Silverlight 4 Rough Notes: Managed Extensibility Framework
Getting Started with Silverlight 4 Beta
![]()
System requirement: Visual Studio 2010 Beta 2 or Visual Web Developer Express 2010 Beta 2
Documentation
Samples
Also check out:
What’s new in Silverlight 4 Beta
***Silverlight 4 Beta – A guide to the new features – Tim Heuer ***
What’s new in Silverlight 4 Beta
A few interesting new features
- Enabling Business Application Development
- The .NET Common Runtime (CLR) now enables the same compiled code to be run on the desktop and Silverlight without change.
- Drag and drop support for databinding and automatically creating bound controls such as listbox,datagrid.
- New datasources window and picker.
- Easy to pick styles and resources to make a good looking application based on designer resources built in Expression Blend.
- Printing
- Print Preview
- Rich Text Area Control
- Text Input
- WCF RIA Services
- Managed Extensibility Framework (MEF)
- Viewbox Control
- Auto-Sizing Columns and Copy from DataGrid
- Navigation Page Loading Extensibility
- Command Property on ButtonBase and Hyperlink
- SelectedValue and SelectedValuePath on the Selector
- Authentication Support with ClientHttpWebRequest
- IDataErrorInfo
- INotifyDataErrorInfo
- Grouping on CollectionViewSource
- Editable CollectionView IEditableCollectionView
- Binding to String Indexers
- StringFormat, TargetNullValue, FallbackValue
- Databinding Support for Dependency Objects
- ObservableCollection<T> Constructor Accepts IList and IEnumerable
- Empowering Richer Experiences
- Fluid UI States for ItemsControl
- Word Based Text Trimming (trailing ellipses)
- Implicit Styles
- MouseWheel Support
- Right Mouse Click
- Programmatic Clipboard Access
- Silverlight as a Drop Target
- Webcam and Microphone Support
- Audio and video “local” recording capabilities capture RAW video without requiring server interaction, enabling a wide range of end-user interaction and communication scenarios for example video conferencing.
- CompositeTransform
- Bring data in to your application with features such as copy and paste or drag and drop.
- Multi-touch support enables a range of gestures and touch interactions to be integrated into user experiences.
- Sandboxed Applications
- WebBrowser Control
- HtmlBrush
- Notifications (Toast) – a popup window on the taskbar
- Control over aspects of UI include window settings such as start position, size and chrome.
- Trusted Applications
- Native Integration, Windows API, COM Automation
- File System Access
- Cross-Domain Networking Access without security policy file
- Full File Path on Open and Save Dialogs
- Full Keyboard in Full Screen Mode
Via JohnPapa.net
Also check out
