DigitalFormLookupButton.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using InABox.Mobile;
  3. namespace PRS.Mobile
  4. {
  5. public class DigitalFormLookupButton : DigitalFormLookupView
  6. {
  7. private readonly MobileButton _button;
  8. protected override void UpdateUI()
  9. {
  10. _button.Text = String.IsNullOrWhiteSpace(_value.Text) ? "Select Value" : _value.Text;
  11. }
  12. public DigitalFormLookupButton()
  13. {
  14. MinimumHeightRequest = 45;
  15. _button = new MobileButton()
  16. {
  17. Text = "Select Value"
  18. };
  19. _button.Clicked += DoLookup;
  20. Content = _button;
  21. }
  22. protected override void UpdateStatus()
  23. {
  24. IsEnabled = !ReadOnly || Definition.Properties.Secure;
  25. var labelcolors = DigitalFormUtils.GetColors(!IsEnabled, Definition.Properties.Required, true);
  26. _button.BackgroundColor = labelcolors.Background;
  27. _button.BorderColor = labelcolors.Border;
  28. _button.TextColor = labelcolors.Foreground;
  29. }
  30. }
  31. }