This project has moved and is read-only. For the latest updates, please go here.

Changets 74533 / 74534 are Breaking Changes

Mar 12, 2011 at 12:52 PM
Edited Mar 12, 2011 at 1:28 PM

Better earlier than later, but want to keep everyone in the loop.

Changeset 74533:

  • I made some changes to help the namespaces conform better. This will break your namespace "using" statements because the plural Views/ViewModels has been changed to View/ViewModel to be in line between "Core" and "Framework."
  • The assembly is now CLS compliant. The Initialize, Activate, and Deactivate methods no longer contain underscores, but they are also no longer public but protected as the public methods are exposed by the base interface.
    • _Initialize -> InitializeVm
    • _Activate -> ActivateView
    • _Deactivate -> DeactivateView
  • Because all of Jounce is now in one assembly, you may find an issue with dynamic modules reporting composition rejections where they weren't before. This is likely because your dynamic XAP references Jounce, which is fine, but you should click the properties for Jounce and set "copy local" to "false" - this avoids loading the assembly multiple times
  • You can now query the view model router interface for more information about views
    • GetMetadataForView - gives the IExportViewAsMetadata for the view, so you can inspect category, menu name, is shell, etc.
    • GetViewModelTagForView - just what it says, find the corresponding view model and then you can resolve that view model directly
  • Fixed the naming issue in the quick starts for the dynamic calculator

Changeset 74534:

  • Add a payload of name value pairs to the navigation
  • Pass the payload into the ActivateView method on the view model
  • Extend the resolve view model to allow injection of the parameters
  • Create helper extension methods to allow .AddNamedParameter("name", T Value) to the navigation args
  • Create helper extension methods to allow .ParameterValue<T>("name") on the navigation args T

The examples for this have been added to "Simple Navigation" in the quick starts. The pertinent code to add parameters:

EventAggregator.Publish(view.AsViewNavigationArgs().AddNamedParameter("Guid", Guid.NewGuid()));

The pertinent code to extract a parameter to the type (will return default if parameter doesn't exist) - the example calls ToString because it is putting the guid contents in a text property:

Text = viewParameters.ParameterValue<Guid>("Guid").ToString();

All quickstarts have been updated. Please use this thread if you have questions or concerns.