UWP XAML Transparent Buttons

It’s crazy but creating a transparent button in XAML seemed to take me forever when I first started with UWP development! So heres the style I eventually came up with, hopefully it will save you guys some time too.

<Style TargetType="Button" x:Key="TransparentButton_Simple">
 <Setter Property="Background" Value="Transparent" />
 <Setter Property="BorderBrush" Value="Transparent" />
 <Setter Property="BorderThickness" Value="0" />
 <Setter Property="BorderBrush" Value="Transparent" />
 <Setter Property="Padding" Value="-1,-1,-1,-1" />
 <Setter Property="Margin" Value="0,0,0,10"/>
 <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
 <Setter Property="HorizontalAlignment" Value="Stretch"/>

Leave a Reply

Your email address will not be published. Required fields are marked *