Hi,
I am currently testing the Ribbon, although this is not a question directly related to this control. I have a DelegateCommand, OpenFileCommand, which can take a String (the file path), but not necessarly (the same command is used to open the Open File Dialog, in case the String is Null). I get the following error, at runtime:
Unable to cast object of type 'ActiproSoftware.Windows.Controls.Ribbon.Input.CheckableCommandParameter' to type 'System.String'
Here is a workaround I found:
<!--Open Button-->
<ribbon:Button Label="Open"
ImageSourceSmall="/MyApp;component/Images\Open.ico"
KeyTipAccessText="O"
Command="{x:Static module:ModuleCommands.OpenFileCommand}"
CommandParameter=" "/>
And in my function, I use IsNullOrWhiteSpace to trigger the opening of the Open File Dialog.
However, I would like to avoid doing this, I am sure there is a way to handle DelegateCommand(Of String) properly?
Thanks
[Modified 10 years ago]