Friday, November 6, 2015

Caliburn.Micro & Windows 10 UWP apps - AmbiguousMatchException

I continued my journey on using Caliburn.Micro in Windows 10 UWP apps. The next thing I tried was to add a device specific view. In UWP apps this can easily be done by adding a second XAML file with the same name and a device family added to it.

For example: a device specific version of ShellView.xaml can be ShellView.DeviceFamily-Mobile.xaml.

Remark: This is not the only way to specify a device specific version. More information here: http://igrali.com/2015/08/02/three-ways-to-set-specific-devicefamily-xaml-views-in-uwp/ 

However after doing that, my Caliburn application started to fail with the following exception:

AmbiguousMatchException: Ambiguous match found

It seems that I’m not the first one with this problem as an issue(and a fix) had already been created on Github: https://github.com/Caliburn-Micro/Caliburn.Micro/pull/227

Unfortunately the fix is , at the moment of writing, not yet released so you have to download the source code and compile the code yourself.

No comments: