我在看下面的XAML代码:Silverlight的命令绑定
<Grid x:Name="LayoutRoot" Background="White">
<Button Content="Say Hello..." VerticalAlignment="Center"
HorizontalAlignment="Center"
my:ButtonService.Command="{Binding Path=SayHello}"
my:ButtonService.CommandParameter="Bob"/>
</Grid>
我想明白是怎么得到的命令没有代码后面的约束。 [我:]点到DLL限定[ButtonService]静态类这反过来定义[CommandProperty]作为的DependencyProperty。
我希望这是背后的代码的一部分,而事实上它是在它自己的类 - ButtonService。
有人可以向我解释它是如何工作的?
完整的代码here:
谢谢AnthonyWJones - 你是对有关点击重新布线,但我仍然不明白,在按钮声明的XAML部分中间,这个'my:ServiceButton.Command'不是按钮的一部分。 – furd 2010-09-17 13:29:34