robinmanuelthiel / flexbutton

Flexible button control for Xamarin.Forms
MIT License
240 stars 34 forks source link

bug in changing backgroudcolor in the code #65

Closed henryyue2010 closed 5 years ago

henryyue2010 commented 5 years ago

Describe the bug It seems there is a bug in changing the flex button backgroundcolor from codes. I have two flex buttons in the content page. I want to change the buttons' backgroundcolor when clicking the buttons. I use the following codes: private void button1_OnClicked(object sender, EventArgs e) { button1.BackgroundColor = Color.Blue; button2.BackgroundColor = Color.White; }

private void button2_OnClicked(object sender, EventArgs e) { button1.BackgroundColor = Color.White; button2.BackgroundColor = Color.Blue; }

but after buttons change to blue, they are not able to change to white

Expected behavior click button1: button1 is blue, button2 is white. click button2: button1 is white, button2 is blue.

I am using FlexButton 0.8.0, Xamarin.Forms 3.1, PCL

anyone met same problem?

AlecDTucker commented 5 years ago

There is something funky happening with the BackgroundColor property. Setting it in line in xaml works fine, but trying to set it in a style doesn't work. Interestingly, intellisense shows two properties called BackgroundColor. Assigning it in line shows them one way round, and works fine. Assigning it in a style shows them the other way round, and has no effect.

This is with FlexButton 0.8, Xamarin.Forms shared project, intellisense provided by MFractor.

robinmanuelthiel commented 5 years ago

Fixed in version 0.9.0: https://www.nuget.org/packages/Forms.Controls.FlexButton/0.9.0

mmacneil commented 5 years ago

In 0.9.0 the issue @AlecDTucker mentions about being unable to set the BackgroundColor property from a Style appears to exist still. I will open a new issue with a sample. @AlecDTucker did you ever update to 0.9.0 and confirm this was fixed?

Thanks, Mark