Dmitrii Kurylev
Dmitrii Kurylev

Reputation: 437

Gray color from button xamarin

I write in Xamarin.Forms PCL. I set BorderRadius from My Button, but if I set disabled it or press on it, show gray border without Border Radius:

enter image description here

I want to clear gray border or set it border radius.

Upvotes: 2

Views: 856

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32785

Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml includes resources that you can use to modify the colors of a control in different visual states without modifying the control template. In apps that target this software development kit (SDK) or later, modifying these resources is preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling section of the Styling controls.

If you override this in your Application.Resources(Xamarin.UWP Client Project) as below:

<Application.Resources>
        <SolidColorBrush x:Key="ButtonBackgroundPressed" Color="White" />
        <SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="White" />
</Application.Resources>

It should take affect everywhere.

enter image description here

Upvotes: 1

Related Questions