我的Infrastructure项目中有一个名为NavigateCommand的CompositeCommand。我使用下面提到的XAML将参数传递给方法:
Command="{x:Static inf:ApplicationCommands.NavigateCommand}"
CommandParameter="{Binding ListSourcePage}"
现在,我想用C#做同样的事情。我该怎么办?
答案 0 :(得分:2)
假设下面的代码在类中,其中声明了ListSourcePage
属性:
if (ApplicationCommands.NavigateCommand.CanExecute(ListSourcePage))
{
ApplicationCommands.NavigateCommand.Execute(ListSourcePage);
}