XAML
<
Window.Resources
>
< Style x:Key ="ButtonStyle2" TargetType =" {x:Type Button} " >
< EventSetter Event ="Click" Handler ="b1SetColor" />
</ Style >
</ Window.Resources >
< Button x:Name ="butrouter" Style =" {DynamicResource ButtonStyle2} " Click ="butrouter_Click" />
< Style x:Key ="ButtonStyle2" TargetType =" {x:Type Button} " >
< EventSetter Event ="Click" Handler ="b1SetColor" />
</ Style >
</ Window.Resources >
< Button x:Name ="butrouter" Style =" {DynamicResource ButtonStyle2} " Click ="butrouter_Click" />
CS
private
void butrouter_Click(
object sender, System.Windows.RoutedEventArgs e)
{
// TODO: Add event handler implementation here.
}
private void b1SetColor( object sender, System.Windows.RoutedEventArgs e)
{
// TODO: Add event handler implementation here.
}
{
// TODO: Add event handler implementation here.
}
private void b1SetColor( object sender, System.Windows.RoutedEventArgs e)
{
// TODO: Add event handler implementation here.
}
先执行butrouter_Click,再执行b1SetColor