Hi Leon
Thanks for your suggestion. I have tried it, but it didnt work.
I am on higher version of Xamarin.Forms then 5.0.0.2196. My version is 5.0.0.2401
Style="{StaticResource MButton}" in Appl.xaml is as follows:
I have applied your code to binding of MButtBckColor1:
Xamarin.Forms.Color mButtBckColor1 = Xamarin.Forms.Color.White;
public Xamarin.Forms.Color MButtBckColor1
{
get { return mButtBckColor1; }
set
{
mButtBckColor1 = value ;
OnPropertyChanged(nameof(mButtBckColor1));
}
}
ViewModel code first time round is
MText1 = "Color Test";
MButtBckColor1 = Xamarin.Forms.Color.DarkCyan;
The way I want App to works is:
First screen displays 16 squares (Buttons) with DarkCyan as Background Color:
User selects squares and color changes. Eg Sq 1 changes to gray:
Then they press a button:
ActionCommand is in ViewModel:
public ICommand ActionMCommand
{
get
{
return new Command(() =>
{
SelectMData();
ResetCellsData();
});
}
}
ResetCellsData resets the button color to default:
public void ResetCellsData()
{
MButtBckColor1 = Xamarin.Forms.Color.DarkCyan;
\\ other Buttons
}
ResetCellsData gets called and sets the
MButtBckColor1 R=0, G=0.545098066329956, B=0.545098066329956, A=1, Hue=0.5, Saturation=1, Luminosity=0.272549033164978 Xamarin.Forms.Color
But the MButtBckColor1 does not change when it gets refreshed. It stays Grey.