123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using ReactiveUI;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reactive;
- using System.Text;
- using System.Threading.Tasks;
- namespace AvaloniaApplication4.ViewModels
- {
- internal class AuthViewModel
- {
- public class LoginViewModel : ViewModelBase
- {
- private string _username;
- private string _password;
- public string Username
- {
- get => _username;
- set => this.RaiseAndSetIfChanged(ref _username, value);
- }
- public string Password
- {
- get => _password;
- set => this.RaiseAndSetIfChanged(ref _password, value);
- }
- public ReactiveCommand<Unit, Unit> LoginCommand { get; }
- public LoginViewModel()
- {
- LoginCommand = ReactiveCommand.Create(Login);
- }
- private void Login()
- {
- // Реализуйте здесь логику авторизации
- Console.WriteLine($"Logging in: Username - {_username}, Password - {_password}");
- }
- }
- }
- }
|