How to make AppBarButton have round corner with style

Javier R 211 Reputation points
2022-06-19T09:54:38.077+00:00

How to make AppBarButton have round corner with style. Apply style the AppBarButton does not come out with the cornerRadius and when I pulse the button is tilted when I click on the animation it comes out normal

212670-2022-06-19-3.png

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,851 Reputation points
    2022-06-20T02:19:10.367+00:00

    Hello,
    Welcome to Microsoft Q&A!

    How to make AppBarButton have round corner with style

    AppBarButton has CornerRadius property, you could give a available CornerRadius value for setting round corner for AppBarButton

    <Style TargetType="AppBarButton">  
        <Setter Property="CornerRadius" Value="10"/>  
    </Style>  
    

    Update

    Please delete PointerDownThemeAnimation from PointerOver and Pressed VisualState, And add CornerRadius property for RootGrid

     <Grid x:Name="RootGrid" CornerRadius="{TemplateBinding CornerRadius}" >  
    

    Usage

     <AppBarButton CornerRadius="10"  Style="{StaticResource AppBarButtonCustomStyle}" Label="Test" Icon="Accept"/>  
    

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful