我有一个 ViewModel 使用DelegateCommand
属性绑定到Button
的Command
属性。
问题是我的示例数据不喜欢该DelegateCommand
对象。它抱怨说:The type "DelegateCommand" does not include any accessible constructors.
此外,唯一暴露的财产是IsActive
财产。
<local:MyViewModel xmlns:local="clr-namespace:MyNamespace"
xmlns:prism="http://www.codeplex.com/prism">
<local:MyViewModel.Age>47</local:MyViewModel.Age>
<local:MyViewModel.PurchaseAlcohalCommand>
<prism:DelegateCommand IsActive="True" />
</local:MyViewModel.PurchaseAlcohalCommand>
</local:MyViewModel>