
Hello,
I am running into a situation I am not sure how to solve. Basically I have created a implementation of the ICommand interface that allows the parameter to be type save as such.In my ribbon I have the following.
However when it runs I get a cast exception. It appears the ribbon is not using the parameter I specify?
2009-12-30 15:51:43,102 [10] FATAL SFM.Net.Application.Shell.App [(null)] - Unhandled Exception Received: System.InvalidCastException: Unable to cast object of type 'ActiproSoftware.Windows.Controls.Ribbon.Input.CheckableCommandParameter' to type 'SFM.Net.Infrastructure.Commands.SaveCommandParameter'.
at Microsoft.Practices.Composite.Wpf.Commands.DelegateCommand`1.System.Windows.Input.ICommand.CanExecute(Object parameter)
I am running into a situation I am not sure how to solve. Basically I have created a implementation of the ICommand interface that allows the parameter to be type save as such.
SimpleCommand<SaveCommandParameter> SaveCommand = new SaveCommand<SaveCommandParameter>(CanExecute, Execute);
<ribbon:Button Name="saveButton"
Label="Save"
Command="{Binding Path=SaveCommand}"
CommandParameter="{Binding Path=SaveCommandParameter}"
ImageSourceSmall="{ImageResources:StringResource Save}"
ImageSourceLarge="{ImageResources:StringResource Save}"
ToolTip="Save (F9 or Ctrl+S)"></ribbon:Button>
2009-12-30 15:51:43,102 [10] FATAL SFM.Net.Application.Shell.App [(null)] - Unhandled Exception Received: System.InvalidCastException: Unable to cast object of type 'ActiproSoftware.Windows.Controls.Ribbon.Input.CheckableCommandParameter' to type 'SFM.Net.Infrastructure.Commands.SaveCommandParameter'.
at Microsoft.Practices.Composite.Wpf.Commands.DelegateCommand`1.System.Windows.Input.ICommand.CanExecute(Object parameter)