MetroAppircleButton中的MahApps Metro Badge

时间:2017-09-04 11:03:09

标签: c# wpf mahapps.metro badge

如果我尝试在MetroCircleButton的内容周围放置徽章,则边距太大而且似乎不属于该按钮。

  <Controls:Badged Width="45"
            Grid.Row="0"
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"
            BadgePlacementMode="BottomRight"                            
            Margin="0,0,200,0"
            Badge="3">

         <Button
            x:Name="btnModificaciones"
            Width="45"
            Height="45"              
            BorderBrush="#FF060606"
            Click="btnModificaciones_Click"
            Cursor="Hand"
            Style="{DynamicResource MetroCircleButtonStyle}">

                <iconPacks:PackIconFontAwesome
                    Width="20"
                    Height="20"
                    Foreground="#FF080808"
                    Kind="Wrench" />
         </Button>

</Controls:Badged>

badge in metrocirclebutton

1 个答案:

答案 0 :(得分:1)

您可以使用否定Padding将徽章移近Button

<Controls:Badged Width="45"
            Grid.Row="0"
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"
            BadgePlacementMode="BottomRight"                            
            Margin="20"
            Padding="0 0 -10 -10"
            Badge="3">

    <Button
            x:Name="btnModificaciones"
            Width="45"
            Height="45"              
            BorderBrush="#FF060606"
            Cursor="Hand"
            Style="{DynamicResource MetroCircleButtonStyle}">

        <iconPacks:PackIconFontAwesome
                    Width="20"
                    Height="20"
                    Foreground="#FF080808"
                    Kind="Wrench" />
    </Button>

</Controls:Badged>