1using CommunityToolkit.Mvvm.ComponentModel;
22 this.ConnectionStateColor =
new SolidColorBrush(Colors.Red);
23 this.StateSummaryText =
string.Empty;
31 await base.OnInitializeAsync();
40 await base.OnDisposeAsync();
49 private string connectionStateText;
55 private Brush connectionStateColor;
61 private string stateSummaryText;
67 private bool isConnected;
77 this.ConnectionStateText = State.ToDisplayText();
78 this.ConnectionStateColor =
new SolidColorBrush(State.ToColor());
79 this.IsConnected = State ==
XmppState.Connected;
80 this.StateSummaryText = (
ServiceRef.
TagProfile.LegalIdentity?.State)?.ToString() +
" - " + this.ConnectionStateText;
90 return MainThread.InvokeOnMainThreadAsync(() =>
A strongly-typed resource class, for looking up localized strings, etc.
static string XmppState_Offline
Looks up a localized string similar to Disconnected.
Base class that references services in the app.
static ITagProfile TagProfile
TAG Profile service.
static IReportingStringLocalizer Localizer
Localization service
static IXmppService XmppService
The XMPP service for XMPP communication.
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
A view model that holds the XMPP state.
XmppViewModel()
Creates an instance of a XmppViewModel.
virtual void SetConnectionStateAndText(XmppState State)
Sets both the connection state and connection text to the appropriate value.
override async Task OnDisposeAsync()
Method called when the view is disposed, and will not be used more. Use this method to unregister eve...
virtual Task XmppService_ConnectionStateChanged(object? _, XmppState NewState)
Listens to connection state changes from the XMPP server.
override async Task OnInitializeAsync()
Method called when view is initialized for the first time. Use this method to implement registration ...
XmppState
State of XMPP connection.