导航通用菜单按钮样式

 <!--导航通用菜单按钮样式-->
    <Style x:Key="MenuButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid x:Name="grid">
                        <Border x:Name="border" BorderThickness="1" CornerRadius="2" BorderBrush="Transparent">
                            <Border x:Name="border1" BorderBrush="Transparent" BorderThickness="1" CornerRadius="2"  Background="Transparent">
                                <Grid  x:Name="stackPanel">
                                    <ContentPresenter x:Name="cp" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                                </Grid>
                            </Border>
                        </Border>
                        <Border x:Name="FocusVisualElement"  BorderThickness="1" Margin="0,0,0,0" CornerRadius="2" Visibility="Collapsed" IsHitTestVisible="False">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                    <GradientStop Color="#00858585"/>
                                    <GradientStop Color="#00838383" Offset="1"/>
                                    <GradientStop x:Name="gpDynamic"  Color="#FFF7F7F7"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="cp" Value="0.4"/>
                            <!--<Setter Property="BorderBrush" TargetName="border" Value="#FFC8C8C9"/>
                            <Setter Property="Background" TargetName="border1">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="White" Offset="0.009"/>
                                        <GradientStop Color="#FFFBFBFB" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>-->
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}"/>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}"/>
                            <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}"/>
                            <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}"/>
                            <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}"/>
                            <!--<Setter Property="Visibility" TargetName="FocusVisualElement" Value="{StaticResource Visible}"/>
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation EasingFunction="{StaticResource ExponentialEase}" Storyboard.TargetName="gpDynamic" Storyboard.TargetProperty="Offset" From="0" To="1" Duration="0:0:0.4"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>-->
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

前台调用

  <StackPanel>
            <StackPanel x:Name="StackPanel_SelectData" Orientation="Horizontal" Margin="0,0"  Background="WhiteSmoke">
                <Button x:Name="Button_SelectAll" Margin="2,1,0,1" Padding="2,0" IsTabStop="False" Style="{StaticResource MenuButtonStyle}" ToolTipService.ToolTip="选择所有" ToolTipService.Placement="Bottom" Click="Button_SelectAll_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Camew.Lottery.App.Style;Component/Images/SelectAll.png" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="全选"  VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button x:Name="Button_SelectNone" Margin="0,1" Padding="2,0" IsTabStop="False" Style="{StaticResource MenuButtonStyle}" ToolTipService.ToolTip="取消选择" ToolTipService.Placement="Bottom" Click="Button_SelectNone_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Camew.Lottery.App.Style;Component/Images/SelectNone.png" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="清除"  VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button x:Name="Button_SelectBack" Margin="0,1" Padding="2,0" IsTabStop="False" Style="{StaticResource MenuButtonStyle}" ToolTipService.ToolTip="反选" ToolTipService.Placement="Bottom" Click="Button_SelectBack_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Camew.Lottery.App.Style;Component/Images/Refresh.png" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="反选"  VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>

                <Button x:Name="Button_SelectDan" Margin="0,1" Padding="2,0" IsTabStop="False" Style="{StaticResource MenuButtonStyle}" ToolTipService.ToolTip="全选单" ToolTipService.Placement="Bottom" Click="Button_SelectDan_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Camew.Lottery.App.Style;Component/Images/Filter.png" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="全单"  VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button x:Name="Button_SelectShuang" Margin="0,1" Padding="2,0" IsTabStop="False" Style="{StaticResource MenuButtonStyle}" ToolTipService.ToolTip="全选双" ToolTipService.Placement="Bottom" Click="Button_SelectShuang_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Camew.Lottery.App.Style;Component/Images/Filter.png" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="全双"  VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button x:Name="Button_SelectDa" Margin="0,1" Padding="2,0" IsTabStop="False" Style="{StaticResource MenuButtonStyle}" ToolTipService.ToolTip="全选大" ToolTipService.Placement="Bottom" Click="Button_SelectDa_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Camew.Lottery.App.Style;Component/Images/Filter.png" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="全大"  VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button x:Name="Button_SelectXiao" Margin="0,1" Padding="2,0" IsTabStop="False" Style="{StaticResource MenuButtonStyle}" ToolTipService.ToolTip="全选小" ToolTipService.Placement="Bottom" Click="Button_SelectXiao_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Camew.Lottery.App.Style;Component/Images/Filter.png" Height="16" Margin="0,0,2,0"/>
                        <TextBlock Text="全小"  VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>

            </StackPanel>
            <WrapPanel x:Name="NumbersPanel" Margin="10,5,10,10" >
                <!--<ToggleButton Content="9" RGBCtrl:GlobalResourceService.StyleKey="ToggleButton_Ball"/>-->
            </WrapPanel>
        </StackPanel>


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值