日期:2014-05-17  浏览次数:20895 次

WPF,请问下这个路由事件怎么截取?

<Window.Resources>
    <Style x:Key="aa" TargetType="Control">
        <Setter Property="Background" Value="Wheat"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <Grid>
                        <TextBlock Text="汤姆" Background="Wheat"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="bb" TargetType="Control">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="张三" Background="Red"/>
                        <TextBlock Text="李四" Grid.Row="1" Background="Yellow"/>
                        <Control Style="{StaticResource aa}" Grid.Row="2" Background="Wheat"/>
                    </Grid>
                </ControlTemplate>
            &