Files
qController/qController.Standard/Classes/Buttons/QButton.cs
T
2023-11-26 10:02:14 -06:00

46 lines
1.2 KiB
C#

using Xamarin.Forms;
namespace qController
{
public class QButton : Button
{
public QCommand qCommand
{
get;
set;
}
public QButton(QCommand command)
{
qCommand = command;
Text = qCommand.text;
TextColor = Color.Black;
FontSize = App.WidthUnit * 5;
if (qCommand.osc.Contains("go"))
{
BackgroundColor = Color.SeaGreen;
switch (Device.RuntimePlatform)
{
case Device.iOS:
FontSize = App.HeightUnit * 4;
FontAttributes = FontAttributes.Bold;
break;
case Device.Android:
FontSize = App.HeightUnit * 4;
FontAttributes = FontAttributes.Bold;
break;
}
}
else if (qCommand.osc.Contains("panic"))
{
BackgroundColor = Color.IndianRed;
}
else
{
BackgroundColor = Color.FromHex("D8D8D8");
}
}
}
}