In my case, it was the CommandParameter type that was causing the problem. My button was simply connected as follows:
<Button Content="New" Command="{Binding NewCommand}" CommandParameter="False" />
The foundation of NewCommand is RelayCommand<bool> . Somehow XAML could not translate False into bool. (Note that it works for many built-in types and properties, maybe some TypeConverter or something in action there).
The solution was to simply spell XAML with a false CommandParameter type, like this:
<Button Content="New" Command="{Binding NewCommand}"> <Button.CommandParameter> <sys:Boolean> False </sys:Boolean> </Button.CommandParameter> </Button>
You need to import the sys namespace at the top of your XAML file, for example:
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Hope this helps someone along the way.
source share