I have tried to use Custom Renderer but I can not change the background of the button in uwp, it is always gray. This is what I have done:
public class MyButtonRenderer : ButtonRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
{
base.OnElementChanged(e);
if (Control != null)
{
Control.Foreground = new SolidColorBrush(Colors.Black);
Control.BackgroundColor = new SolidColorBrush(Colors.White);
Control.Background = new SolidColorBrush(Colors.White);
}
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
Control.Foreground = new SolidColorBrush(Colors.Black);
Control.BackgroundColor = new SolidColorBrush(Colors.White);
Control.Background = new SolidColorBrush(Colors.White);
}
}
Any clue or suggestion?
Thanks;