Releases: Caliburn-Micro/Caliburn.Micro
Caliburn.Micro 3.1.0
A small feature and bug fix release to clean out some of the backlog before 4.0.0.
Included are the following
- #439 Fixes up an issue using commas in constant values
cm:Message.Attach="ShowTitle('One, Two, Three')" - #432 Stop calling
InitializeCompontenton Xamarin.Forms, this was mostly used for a underused feature of.xamlfiles without a code behind. On the non-XF platforms this method has re-entry protection, the XF version did not. - #423 Fixes a null reference in the
Setup.WPFsample. - #417 Handle a
ContentPropertyAttributethat doesn't supply a property name (WPF'sFramedoes this). - #364 Support
OnViewLoadedin Xamarin.Forms when the view is aContentPage. - #352 Add an extension point
BindingScope.GetVisualParentto help people who use visual "bridge" libraries. - #319 Add
$clickedItemSpecial Value for WinRT / UWP based projects. - #278 Add a navigation service for WPF and Silverlight with a sample. Note this service may change in
4.0.0with an effort to align all the navigation services. - #247 Add an extension point on
PropertyChangedBaseandBindableCollection<T>namedOnUIThreadto allow people to customize how property changed notifications are dispatched to the UI thread.
Caliburn.Micro 3.0.3
This is a very small release that reverts #339.
This release changed behavior so that views were resolved from the container in the same way as view models. The change in behavior caused problems for applications using containers that threw exceptions on failure to resolve a dependency.
This change should have been considered a breaking change and left to 4.0.0 and considered more seriously. For that I apologize.
It's also contains a typo in documentation fix. #402
Caliburn.Micro 3.0.2
This is a minor bug fix release.
- Fixed support for child view models at design time. #214, #358, #359, #379
Caliburn.Micro.Xamarin.Formsnuget package now depends onCaliburn.Microfor applications helping to ensure you have all the right packages. #323- Stopped extra calls to
InitializeComponentin Xaamarin.Forms. #326 - Support .NET 4.0 in the
Caliburn.Micro.Startnuget package. #348 - Ensure view model activation and deactivation is happening on back navigation in Xamarin.Forms. #342
ContentViewbindings correctly deal with message targets in Xamarin.Forms. #349- Convention added for
DocumentViewerin WPF. #368 - Added some generic overloads to methods on SimpleContainer. #390
ViewLocatorwill now correctly callGetInstancefor resolution of the view falling back to manual instantiation. #339 Update: This change was reverted in 3.0.3
The highest impact bug fix for this release is the last one, previously the ViewModelLocator would call GetInstance to try to resolve the view model (falling back to GetAllInstances and then manual instantiation), ViewLocator however previously only called GetAllInstances.
This release makes them consistent, however it could cause problems if you're throwing exceptions on no resolution of a service from the container. I'd recommend if you are doing this checking whether the type is assignable to UIElement (or some view type) and return null (or skip throwing the exception).
Caliburn.Micro 3.0.1
Caliburn.Micro 3.0.0
I'm really pleased to finally announce the release of Caliburn.Micro 3.0.0 after a long period of being in beta. The major features of 3.0.0 are Windows 10 / UWP and Xamarin.Forms support. With this release you can use your view models across all major platforms that support C#!
It's important to note this is a change in the major versions to there may be breaking changes.
Windows 10
The Windows 10 release follows along with the Windows 8.1 and Windows Phone 8.1 releases and combines them into a single library which is great from a maitenance perspective. If we need to start adding features specific to Phone, Xbox or even HoloLens they'll be done using feature detection via Windows.Foundation.Metadata.ApiInformation.
It includes conventions for new controls such as SplitView.
Also included is a sample showing how to set up a SplitView style app with the Frame not being the root visual but inside the ShellView, this sample is available at Hello UWP.
We now use the new open sourced XAML Behaviours package.
Windows 8.1
- Fix for transparent tiles in App Manifest Helper
Windows 8.0
This release drops support for Windows 8.0 (different from Windows 8.1).
Xamarin Forms
This release brings support for Xamarin.Forms which in abstraction layer over the different UIs in iOS, Android and Windows Phone Silverlight (Windows 8 / 10 support coming later). What's really interesting is that it comes with it's own XAML syntax (not the same as Windows XAML but very similar), this means we can get a closer to standard Caliburn.Micro experience. I was pleasantly surprised by how much I got ported reasonable easy.
There are some limitations of the Xamarin.Forms flavour of of XAML, primarily there is no programmatic access to x:Name mean we cannot support named based conventions. We can still support attached properties such as cm:Message.Attach as well as convention based view / view model location.
<ListView ItemsSource="{Binding Features}" HasUnevenRows="True"
cm:Message.Attach="[Event ItemSelected] = [ShowFeature($selectedItem)]">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ContentView cm:View.Model="{Binding}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>Also included is the now standard navigation service and navigation helper methods
navigationService.For<ProductViewModel>()
.WithParam(v => v.ProductId, 42)
.Navigate();A sample of this sort of app is can be found at Hello.Forms in the GitHub repository.
One of the more interesting features here is that Xamarin.Forms runs on top of the existing mobile platform (Xamarin.iOS, Xamarin.Android and Windows Phone Silverlight). This makes it the first version where two different platforms of Caliburn.Micro have to run side by side. We essentially have two instances of ViewModelLocator, one in Caliburn.Micro.ViewModelLocator for the current host platform and one at Caliburn.Micro.Xamarin.Forms.ViewModelLocator if Xamarin.Forms is present.
Xamarin.iOS and Xamarin.Android
This release primarily targets Xamarin.Forms, however work has been done to allow your view models to be reused within a Xamarin.iOS or Xamarin.Android applications with no support around binding or conventions.
These features will be added in later feature releases.
A sample of this sort of app is can be found at Hello.Xamarin in the GitHub repository.
Preserving State
One new feature in this release is the CachingFrameAdapter. This subclass of FrameAdapter (which implements INavigationService in WinRT platforms such as Windows 8.1, Windows Phone 8.1 and Windows 10) will cache internally view models and reuse them on the appropriate navigation. This allows scenarios where the built in NavigationCacheMode doesn't make sense but still preserve your view model state. A sample of this in action is available at Caliburn.Micro.State.
Other Changes
- Resolved a WPF bug using
MainWindowwhen it's disposed. - Resolved
ViewLocator.LocateForModelTypefailing to deal with improperly reused views in WinRT. - Resolved a premature garbage collection issue in
Action.Invoke. - Removed a unnecessary explicate collection in
FrameAdapter. BindingScopehas been cleaned up a lot so will be easier to extend.- Async methods are now taken into account for conventions.
CanLoginwill be used as a guard forLoginAsyncand will be attached to a control withxName="Login". - Better handling of scenarios where a root frame is not being used with the navigation service.
- Removed the case sensitivity when adding custom special values to
MessageBinder. Screen.IsActive,Screen.IsInitialisedandPropertyChangedBase.IsNotifyingare now virtual, we don't see then behaviour being overriden but a lot apps will need to add their own custom attributes to these properties.
Breaking Changes
- The extensions projects have moved into the main platform assembly, these were initially created as a place for very platform specific code but they've outlived there usefulness and removing them reduces some maintenance costs.
Bind.Modelhad a feature enabling you to pass a string which usedIoCto find the model. This was deprecated in 2.0.0 and has now been removed.SimpleContainernow only uses public constructors.- The
UriFormethod has been deprecated in favour of justForgiven the lack of uri support on a number of platforms. - WinRT platforms now make use of
AssemblySourceCachewhich means if your view models do not implementINotifyPropertyChangedor views subclass fromUIElementthen they may not be found byViewLocatororViewModelLocator. This behaviour can be changed by modifyingAssemblySourceCache.ExtractTypes.
Thanks
Thank you to all who have contributed fixes, reported issues and generally feedback on the extended pre-release versions.
As well a bit thanks to Marker Metro who sponsored a lot of the time it took me to put this 3.0.0 release together.
Caliburn.Micro 3.0.0-beta2
All the release notes from 3.0.0-alpha and 3.0.0-beta1 apply to this release as well.
Windows 10
- Added runtime directives to help with .NET Native compilation.
- Added a missing convention for
SplitView
Windows 8.1
- Fix for transparent tiles in App Manifest Helper. Thanks @0x8DEADF00D
Other Changes
- Uses the new open source UWP Behaviors nuget package.
- Async methods are now taken into account for conventions.
CanLoginwill be used as a guard forLoginAsyncand will be attached to a control withxName="Login". Thanks @BrunoJuchli - Better handling of scenarios where a root frame is not being used with the navigation service.
Breaking Changes
All the breaking changes from 3.0.0-alpha and 3.0.0-beta1 apply to this release as well.
DefaultPlatformProviderhas been removed withPlatformProvider.Currentnow throwing an exception if not correctly initialized.
Caliburn.Micro 3.0.0-beta1
All the release notes from 3.0.0-alpha apply to this release as well.
Windows 10
The Windows 10 release follows along with the Windows 8.1 and Windows Phone 8.1 releases and combines them into a single library which is great from a maitenance perspective. If we need to start adding features specific to Phone, Xbox or even HoloLens they'll be done using feature detection via Windows.Foundation.Metadata.ApiInformation.
Also included is a sample showing how to set up a SplitView style app with the Frame not being the root visual but inside the ShellView, this sample is available at Hello UWP.
Preserving state
One new feature in this release is the CachingFrameAdapter. This subclass of FrameAdapter (which implements INavigationService in WinRT platforms such as Windows 8.1, Windows Phone 8.1 and Windows 10) will cache internally view models and reuse them on the appropriate navigation. This allows scenarios where the built in NavigationCacheMode doesn't make sense but still preserve your view model state. A sample of this in action is available at Caliburn.Micro.State.
Xamarin Forms
- Included
NavigationHelperwhich adds theFor<TViewModel>method to allow easier view model navigation.
navigationService.For<ProductViewModel>()
.WithParam(v => v.ProductId, 42)
.Navigate();Other Changes
- Resolved a WPF bug using
MainWindowwhen it's disposed. Thanks dvdorle. - Resolved
ViewLocator.LocateForModelTypefailing to deal with improperly reused views in WinRT. - Resolved a premature garbage collection issue in
Action.Invoke. - Removed a unnecessary explicate collection in
FrameAdapter. BindingScopehas been cleaned up a lot so will be easier to extend.
Breaking Changes
All the breaking changes from 3.0.0-alpha apply to this release as well.
- The extensions projects have moved into the main platform assembly, these were initially created as a place for very platform specific code but they've outlived there usefulness and removing them reduces some maintenance costs.
Bind.Modelhad a feature enabling you to pass a string which usedIoCto find the model. This was deprecated in 2.0.0 and has now been removed.SimpleContainernow only uses public constructors. Thanks belyansky.- The
UriFormethod has been deprecated in favour of justForgiven the lack of uri support on a number of platforms. - WinRT platforms now make use of
AssemblySourceCachewhich means if your view models do not implementINotifyPropertyChangedor views subclass fromUIElementthen they may not be found byViewLocatororViewModelLocator. This behaviour can be changed by modifyingAssemblySourceCache.ExtractTypes.
Caliburn.Micro 3.0.0-alpha
What's New?
- Caliburn.Micro.Core now supports Xamarin platforms.
- Limited support for Caliburn.Micro features in Xamarin native projects.
- Major support for Xamarin.Forms.
More information can be found on the announcement
Known Issues
- The current Storyboard designer for iOS in Visual Studio doesn't respect the folde r/ namespace it's placed in when generating types, as such the current conventions for view model locator
MyApp.ViewControllers.LoginViewControllertoMyApp.ViewModels.LoginViewModelmay not make sense in the long term. - There is no programmatic access to
x:Namein Xamarin.Forms, therefore the feature of name based conventions will not be available, you will need to use normal{Binding Username}andcm:Message.Attach="SignIn". - There is no way to check to see if a
BindablePropertyhas aBindingset. Thankfully we only use this ensure name based conventions don't overwrite existing bindings, given the first issue this is currently less of a problem. - I'm not entirly happy with
FormsApplicationand that both Caliburn.Micro and Xamarin.Forms want to set a customUIApplicationDelegate, we'll need a better way of playing together nicely.
Breaking Changes
Right now there are no breaking API changes for the existing platforms there are some ABI ones, given the new multi-platform scenario with Xamarin Forms I've introduced a new assembly Caliburn.Micro.Platform.Core that holds some of the internal classes used the various platform assemblies. This lets us have to platforms at the same time without any type collision.
If you're using nuget then this new assembly will automatically be referenced, but if you're doing any sort of manual references you may need to check this out. I've applied this change to all the "modern" platforms (.NET 4.5, Windows Phone 8, Windows 8, Windows 8.1 Windows Phone 8.1, Xamarin.iOS and Xamarin.Android). Due to the PCL profile restrictions the .NET 4.0 and Silverlight 5 platforms work as they previously did.
As the alpha progresses I expect there will be breaking changes on the Xamarin platforms, and I don't expect many if any changes on the others.
Thanks to all who contributed fixes, logged bugs etc.
Caliburn.Micro 2.0.2
What's New?
- Resolved some design time bugs.
PropertyChangedBase.Refreshis now virtual.- Added checks to guard against an async CanClose.
- Allow
SettingsWindowManagerto open independent flyouts [WinRT]. - Deal with unicode in C# identifiers.
AttachedCollection.On*methods are now virtual.ViewAware.GetViewis now virtual`.ViewLocator.LocateForModelfalls back toLocateForModelTypeif the view could not be added to the visual tree.ActionMessage.UpdateAvailablilityis now virtual.- Removed explicit garbage collection from WinRT
FrameAdapter. - Resolved a bug where couldn't navigate to a view model that contained the name of the assembly.
Thanks to all who contributed fixes, logged bugs etc.
Caliburn.Micro 2.0.1
What's New?
- Resolved compilation errors in the Caliburn.Micro.Start package due to the breaking changes in 2.0.0.
PropertyChangedBasesupports DataContract serialization on appropriate platforms.- Windows Phone 8.1 now exposes an
INavigationService.BackPressedto better let apps handle and potentially cancel hardware back button events. - Added a convention for Windows Phone 8.1
Pivot. - Resolved a bug where
OnViewReadyargument was null. ActionMessageis more resilient to null values.- Resolved BindingScope.FindNamedDescendants crashed on DependencyObjects
- Added
View.IsInDesignMode.
Thanks to all who contributed fixes, logged bugs etc.