using System; using InABox.Mobile; namespace PRS.Mobile { public class DigitalFormLookupButton : DigitalFormLookupView { private readonly MobileButton _button; protected override void UpdateUI() { _button.Text = String.IsNullOrWhiteSpace(_value.Text) ? "Select Value" : _value.Text; } public DigitalFormLookupButton() { MinimumHeightRequest = 45; _button = new MobileButton() { Text = "Select Value", CornerRadius = 5 }; _button.Clicked += DoLookup; Content = _button; } protected override void UpdateStatus() { IsEnabled = !ReadOnly || Definition.Properties.Secure; var labelcolors = DigitalFormUtils.GetColors(!IsEnabled, Definition.Properties.Required, true); _button.BackgroundColor = labelcolors.Background; _button.BorderColor = labelcolors.Border; _button.TextColor = labelcolors.Foreground; } } }