public void SetTextAndMode(string text, DisplayMode displayMode) { MainThreadUtility.InvokeOnMain(() => { //if text null, get default text for mode switch (displayMode) { case DisplayMode.Reconnecting: if (String.IsNullOrEmpty(text)) { text = Aquamonix.Mobile.Lib.Domain.StringLiterals.Reconnecting; } break; case DisplayMode.ServerDown: if (String.IsNullOrEmpty(text)) { text = Aquamonix.Mobile.Lib.Domain.StringLiterals.ServerNotAvailable; } break; case DisplayMode.Connected: if (String.IsNullOrEmpty(text)) { text = Aquamonix.Mobile.Lib.Domain.StringLiterals.Connected; } break; } //set background color this.BackgroundColor = GraphicsUtility.ColorForReconBar(displayMode);; //and set text this.SetText(text); }); }
public ReconnectingView(TopLevelViewControllerBase parent) : base() { ExceptionUtility.Try(() => { this.BackgroundColor = GraphicsUtility.ColorForReconBar(DisplayMode.Reconnecting); this._parent = new WeakReference <TopLevelViewControllerBase>(parent); this._messageLabel.SetFontAndColor(new UI.FontWithColor(Fonts.RegularFontName, Sizes.FontSize9, UIColor.White)); }); }