다음을 통해 공유


Plan for Prism for .NET 4.5

The patterns & practices team is working on an update to Prism for WPF to support .NET 4.5. We plan to complete the release in February. Francis just posted our first drop to CodePlex. So go check it out and give us your feedback.

This project was just released. See the blog post announcement.

Scope

Prism library updates

The major theme for the release is to move classes to Portable Class Library (PCL) and to address some of the requested CodePlex issues. In Prism for the Windows Runtime we moved the Event Aggregator to PCL. For this release we will move classes that support MVVM to PCL. For the classes that are moved to PCL, we will make the WPF versions obsolete.

Going forward you will see us put as much into PCL as is appropriate and reasonable.

Here is what we are doing for Prism in this release:

  • ViewModel Locator: migrate ViewModelLocator from Prism for Windows Runtime to be a Portable Class Library and use it in Prism for WPF.
  • BindableBase: migrate BindableBase from Prism for Windows Runtime to a Portable Class Library and use it in Prism for WPF. There is a request to add CallerMemberName to NotificationObject. We decided to port BindableBase from Prism for Windows Runtime to PCL as it already supports CallerMemberName. This means we will make NotificationObject obsolete in this version.
  • Navigation: allow a dev to pass an object as a navigation parameter. This is a CodePlex request.
  • InteractionRequest: migrate InteractionRequest to WPF. This is a CodePlex request.
  • DelegateCommand: migrate DelegateCommand to a Portable Class Library. In a future release, Prism for the Windows Runtime will use the PCL version of the DelegateCommand.

Quickstarts

  • Basic MVVM Quickstart.
    • Create WPF version.
    • Add ViewModel locator.
    • Demonstrate how to construct parent-child Views and ViewModels.
    • Demonstrate how to communicate between parent and child.
  • State-based Navigation Quickstart.
    • Create WPF version.
  • UI Composition Quickstart.
    • Create WPF version
  • View-Switching Navigation
    • Create WPF version

Drops & Release

Francis Cheung posted a drop today to CodePlex. Once we complete the release we will create NuGet packages and publish the source code on the Microsoft download center.

In this Drop

  • Prism
    • ViewModel Locator and Bindable Base ported to PCL
      • NotificationObject is marked obsolete
    • Interaction Request working for WPF
    • Using .NET 4.5.1 and latest version of Unity and the Common Service Locator
    • Navigation passes an object and a string
    • ErrorsContainer, NotificationObject, CompositePresentionEvent marked as obsolete.
  • Basic MVVM QuickStart using Prism ViewModel Locator.
    • The ViewModel Locator uses a convention based approach to wire views and view models. In our XAML we tell the ViewModelLocator to AutoWire the view and the view model.

prism:ViewModelLocator.AutoWireViewModel="true"

    • The convention assumes:
      • View models are in the same assembly as the view types
      • View models are in a .ViewModels child namespace
      • Views are in a .Views child namespace,
      • View model names correspond with view names and end with "ViewModel".
      • For more information on how the ViewModel Locator works see the Prism for Windows Runtime documentation. We will provide documentation on how to modify the default convention.
  • Prism, Stock Trader reference implementation, and Quickstarts updated to use BindableBase (Prism.Core) and PubSubEvent (Prism.PubSubEvents).
  • CodePlex requests resolved
    • 10110 - Unity not compatible with UnityExtensions
    • 9439 - Navigation to an existing view
    • 8121 - Prism ContentControl Region RequestNavigate - View already exists in region
    • 9439 - [MEF] Navigation to an existing View
    • 9118 - Extract Core Application Functionality to Core Assembly (Prism.Core)
    • 9107 - NuGet packaging

Check out the drop and let us know your thought.

Comments

  • Anonymous
    January 17, 2014
    This is great news to hear!  Thanks for doing this and looking forward to the bits!
  • Anonymous
    January 23, 2014
    Is PRISM 4.2 coming to .NET 4.0 ?
  • Anonymous
    January 24, 2014
    Martin, we only plan to release Prism 4.2 for .NET 4.5.1.
  • Anonymous
    January 29, 2014
    It also would be nice to have the option of viewmodel first approche.Or why dou you choose the view first approche?
  • Anonymous
    March 02, 2014
    Sorry. Did I misunderstand something?The projects in the latest drop on CodePlex seem to target Framework 4.5 not 4.5.1 as stated.
  • Anonymous
    March 03, 2014
    Brian, we did change the prism library to target .NET 4.5 instead of 4.51 so anyone that is still on .NET 4.5 can use the library. The Stock Trader RI and the QuickStarts projects are 4.51 which includes a reference to the Prism library for .NET 4.5.Is there an issue with targeting .NET 4.5 instead of 4.51? We are not using new capabilities of .NET 4.51 so we wanted to ensure it works for more developers.blaine
  • Anonymous
    March 11, 2014
    Any chance on seeing Prism 4.2 target Silverlight 5?  C'mon guys, don't forget about us!
  • Anonymous
    March 24, 2014
    When is the release coming of this version?
  • Anonymous
    March 27, 2014
    I have a huge problem with the new 4.2 release. If you use NuGet packages for Prism, Prism.UnityExtension etc. you will get a exception in the UnityBootstrapper::ConfigureContainer as it tries to register the EventAggregator. This is caused be the fact that the EventAggregator now is placed in namespace Microsoft.Practices.Prism.PubSubEvents and not as before in Microsoft.Practices.Prism.Events.What i'm actually trying to say is... you need to update the NuGet package for Prism.UnityExtensions, so it references the correct EventAggregator.(sidenote: it's correct if you compile the PrismLibrary - the problem is with the NuGet pacage version 4.1.0)
  • Anonymous
    March 27, 2014
    Karsten: Thanks for your feedback. The Prism.UnityExtensions as well as Prism.MefExtensions NuGet packages will be updated in the next release.
  • Anonymous
    March 27, 2014
    Karsten: A work-a-round would be to take project references to the latest UnityExtensions code but use the NuGet reference to Prism.PubSubEvents.
  • Anonymous
    March 27, 2014
    Francis C: Looking forward to updated NuGet packages. Is there any roughly time for release of NuGet packages?As for workaround - i was actually thinking in the lines of something like what you suggested. I was planning to just override ConfigureContainer with code from base.
  • Anonymous
    March 27, 2014
    Patrick,We are finalizing the documentation which is taking longer than we expected. We expect that this will be finished in the next 3 weeks.
  • Anonymous
    March 27, 2014
    Etienne,At this point we do not plan to target Silverlight with the release. The Prism 4.1 support Silverlight 5 and will still be available.
  • Anonymous
    April 21, 2014
    Is there any plan to remove the platform restriction so the prim libraries can run as portable libraries on other platforms then windows?
  • Anonymous
    April 21, 2014
    Look like this version of Prism have been released : www.microsoft.com/.../details.aspxBut I don't like the version number you have used (5.0), a version 4.5 would have been easier to understand, and what will you use if you update Prism for .Net 5 now?
  • Anonymous
    April 21, 2014
    Documentation have also been released here : msdn.microsoft.com/.../gg406140.aspx
  • Anonymous
    April 22, 2014
    Yes the code and documentation are now available.  We still have a couple items to publish before everything is ready. I will publish an official blog post later today.
  • Anonymous
    April 25, 2014
    Bejarid,The official announcement just went out. You can read it at aka.ms/prism-wpf-50announcement.
  • Anonymous
    September 02, 2015
    Where can I find example(s) using MEF 2 for Windows Runtime with PCL's?  And a plus using ConventionBuilder to compose the parts instead of Attributes.