向DatePicker添加Blend行为的问题
我正在尝试向DatePicker控件添加Blend行为,以将MVVM-Light RelayCommand绑定到DateChanged事件,如下所示:
我使用以下定义:
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
但是,我一直收到以下错误:
WinRT information: Cannot add instance of type 'Microsoft.Xaml.Interactions.Core.EventTriggerBehavior' to a collection of type 'Microsoft.Xaml.Interactivity.BehaviorCollection'.
我已经在我的项目中(以及在同一个Xaml文件中的其他控件)中以这种方式成功地使用Blend行为将事件绑定到命令,并且DatePicker控件是唯一抛出错误的控件。 有没有其他方法来实现这一点或WinRT DatePickers以这种方式受限?