hi in my silverlight5 and mvvm pattern, i had one mainpage that page contains one button,
<Button Command="MyCommand"> Click Me </Button>
This above error can occur when binding a Command inside a Xaml file.
Why this error coming.. Any Help..
hi in my silverlight5 and mvvm pattern, i had one mainpage that page contains one button,
<Button Command="MyCommand"> Click Me </Button>
This above error can occur when binding a Command inside a Xaml file.
Why this error coming.. Any Help..
你有没有尝试过
<Button Command="{Binding MyCommand}"> Click Me </Button>
解决方案是,
事实上,这种语法的问题在于我们调用命令的方式。前面的示例没有使用 Binding 语法。
我使用了 Binding 关键字。
<Button Command="{Binding MyCommand}"> Click Me </Button>
当然,您需要将 ICommand 属性绑定到所需的命令。
public ICommand MyCommand
{
get {
return ....
}
}