摘要: 在样式中,可以通过使用EventSetter在标记中包括某个预先声明的 XAML 事件处理语法。在应用样式时,所引用的处理程序会添加到带样式的实例中。只能针对路由事件声明EventSetter。下面是一个示例。请注意,此处引用的b1SetColor方法位于代码隐藏文件中。1.xaml<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x: 阅读全文
posted @ 2013-05-01 18:18 Plantastic 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 1.XAML代码<Border Height="50" Width="300" BorderBrush="Gray" BorderThickness="1"> <StackPanel Background="LightGray" Orientation="Horizontal" Button.Click="CommonClickHandler"> <Button Name="YesButton" Width 阅读全文
posted @ 2013-05-01 17:48 Plantastic 阅读(112) 评论(0) 推荐(0) 编辑