1using System.ComponentModel;
2using CommunityToolkit.Mvvm.ComponentModel;
3using CommunityToolkit.Mvvm.Input;
20 protected override async Task OnInitialize()
22 await base.OnInitialize();
24 LocalizationManager.Current.PropertyChanged += this.Localization_Changed;
30 LocalizationManager.Current.PropertyChanged -= this.Localization_Changed;
32 await base.OnDispose();
36 public override async Task DoAssignProperties()
38 await base.DoAssignProperties();
39 await this.SetDomainName();
40 this.NetworkID = $
"{ServiceRef.TagProfile.Account}@{ServiceRef.TagProfile.Domain}";
43 private async
void Localization_Changed(
object? Sender, PropertyChangedEventArgs e)
45 await this.SetDomainName();
48 private async Task SetDomainName()
54 Uri DomainInfo =
new(
"https://" + this.DomainName +
"/Agent/Account/DomainInfo");
57 if (AcceptLanguage !=
"en")
58 AcceptLanguage +=
";q=1,en;q=0.9";
61 new KeyValuePair<string, string>(
"Accept",
"application/json"),
62 new KeyValuePair<string, string>(
"Accept-Language", AcceptLanguage),
63 new KeyValuePair<string, string>(
"Accept-Encoding",
"0"));
64 if (Result is Dictionary<string, object> Response)
66 if (Response.TryGetValue(
"humanReadableName", out
object? Obj) && Obj is
string LocalizedName)
67 this.LocalizedDomainName = LocalizedName;
69 if (Response.TryGetValue(
"humanReadableDescription", out Obj) && Obj is
string LocalizedDescription)
70 this.LocalizedDomainDescription = LocalizedDescription;
98 private string? networkID;
101 private void Continue()
110 private async Task Copy(
object Item)
114 this.SetIsBusy(
true);
116 if (Item is
string Label)
118 await Clipboard.SetTextAsync(Label);
131 this.SetIsBusy(
false);
137 private string domainName =
string.Empty;
140 private string localizedDomainName =
string.Empty;
143 private string localizedDomainDescription =
string.Empty;
146 private async Task ServiceProviderInfo()
148 string title = this.LocalizedDomainName;
149 string message = this.LocalizedDomainDescription;
The Application class, representing an instance of the Neuro-Access app.
static LanguageInfo SelectedLanguage
Selected language.
Base class that references services in the app.
static ILogService LogService
Log service.
static IUiService UiService
Service serializing and managing UI-related tasks.
static ITagProfile TagProfile
TAG Profile service.
static IStringLocalizer Localizer
Localization service
double CheckmarkIconSize
Gets the size of the icon for the checkmark.
double CheckmarkBackgroundSize
Gets the size of the background for the checkmark.
override async Task OnDispose()
double CheckmarkBackgroundCornerRadius
Gets the size of the background for the checkmark.
Static class managing encoding and decoding of internet content.
static Task< object > GetAsync(Uri Uri, params KeyValuePair< string, string >[] Headers)
Gets a resource, given its URI.
string? Domain
The domain this profile is connected to.
RegistrationStep
The different steps of a TAG Profile registration journey.