windows-phone-8 – Windows Phone 8.1 – MVVMLight – 为什么E
发布时间:2020-12-14 02:04:00 所属栏目:Windows 来源:网络整理
导读:我无法在 Windows Phone 8.1应用程序中使用EventToCommand. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8"
我无法在
Windows Phone 8.1应用程序中使用EventToCommand.
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8" 我也尝试使用assembly = GalaSoft.MvvmLight.Extras.WP81 … <controls:PivotItem Name="pivotItem"> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged"> <cmd:EventToCommand Command="{Binding SelectServiceCommand}" CommandParameter="{Binding SelectedIndex,ElementName=pivotItem}"/> </i:EventTrigger> <!-- other stuff --> </i:Interaction.Triggers> 我得到以下错误: >成员“触发器”无法识别或无法访问. 有谁可以帮助我吗? 解决方法
您是针对Silverlight,还是针对Windows Phone 8.1的WinRT(Universal Apps)?
如果你选择了第二个选项,那么在这个blog post MVVM Light中,作者解释了对EventToCommand缺乏支持 – 基本上在WinRT中已经有一个类似于EventToCommand – Behaviors的机制. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |