MainWindowViewModel.cs 960 B

123456789101112131415161718192021222324252627282930
  1. using YtYtAvalonia.Models;
  2. using YtYtAvalonia.Views;
  3. using YtYtAvalonia.ViewModels;
  4. using Avalonia.Controls;
  5. using ReactiveUI;
  6. using YtYtAvalonia.View;
  7. namespace YtYtAvalonia.ViewModels
  8. {
  9. public class MainWindowViewModel : ViewModelBase
  10. {
  11. #pragma warning disable CA1822 // Mark members as static
  12. public static SuharevaContext myConnection = new SuharevaContext();
  13. RegistrationViewModel regPage = new RegistrationViewModel(myConnection);
  14. public RegistrationViewModel RegPage { get => regPage; set => regPage = value; }
  15. #pragma warning restore CA1822 // Mark members as static
  16. public string Greeting => "Welcome to Avalonia!";
  17. public UserControl UC { get => uc; set => this.RaiseAndSetIfChanged(ref uc, value); }
  18. #pragma warning restore CA1822 // Mark members as static
  19. private UserControl uc = new LoginView();
  20. public void LoadRegistrationView() => UC = new RegistrationView();
  21. }
  22. }