Class LoginViewModel
The sign-in form: user ID, password, and the homeserver address for servers without discovery; it also creates accounts, with the registration token and the server's policies when the server asks for them.
Inheritance
LoginViewModel
Assembly: Uniform.Chat.Avalonia.dll
public sealed class LoginViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging
Constructors
|
Edit this page
View Source
The sign-in form: user ID, password, and the homeserver address for servers without discovery; it also creates accounts, with the registration token and the server's policies when the server asks for them.
Declaration
public LoginViewModel(Func<SignIn, Task> signIn, IAccountCreator? creator = null)
Parameters
Fields
|
Edit this page
View Source
Address of the app's privacy policy.
Declaration
public const string PrivacyPolicyUrl = "https://github.com/tagcode/Uniform.Chat/blob/main/user-docs/Uniform.Chat.Android/privacy-policy.md"
Field Value
|
Edit this page
View Source
Address of the app's user policy, which people accept by signing in.
Declaration
public const string UserPolicyUrl = "https://github.com/tagcode/Uniform.Chat/blob/main/user-docs/Uniform.Chat.Android/user-policy.md"
Field Value
Properties
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool AcceptTerms { get; set; }
Property Value
|
Edit this page
View Source
ActionText
Declaration
public string ActionText { get; }
Property Value
|
Edit this page
View Source
Whether accounts can be created here.
Declaration
public bool CanRegister { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasError")]
[ExcludeFromCodeCoverage]
public string ErrorMessage { get; set; }
Property Value
|
Edit this page
View Source
Whether there is an error to show.
Declaration
public bool HasError { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool HasPolicies { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Homeserver { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyCanExecuteChangedFor("SignInCommand")]
[ExcludeFromCodeCoverage]
public bool IsBusy { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("Title", new string[] { "ActionText", "SwitchText" })]
[ExcludeFromCodeCoverage]
public bool IsRegistering { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool NeedsToken { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyCanExecuteChangedFor("SignInCommand")]
[ExcludeFromCodeCoverage]
public string Password { get; set; }
Property Value
|
Edit this page
View Source
The server's policies to accept before registering.
Declaration
public ObservableCollection<TermsPolicy> Policies { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string RegistrationToken { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.LoginViewModel.SignInAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand SignInCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.LoginViewModel.SwitchMode().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand SwitchModeCommand { get; }
Property Value
|
Edit this page
View Source
SwitchText
Text of the button that switches between signing in and creating an account.
Declaration
public string SwitchText { get; }
Property Value
|
Edit this page
View Source
Declaration
public string Title { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyCanExecuteChangedFor("SignInCommand")]
[ExcludeFromCodeCoverage]
public string UserId { get; set; }
Property Value
Implements