MainWindowViewModel.cs 797 B

12345678910111213141516171819202122232425262728
  1. using Avalonia.Controls;
  2. using CalculatorSuperNew.Views;
  3. using ReactiveUI;
  4. namespace CalculatorSuperNew.ViewModels
  5. {
  6. public class MainWindowViewModel : ViewModelBase
  7. {
  8. UserControl us = new LoginPage();
  9. public UserControl US { get => us; set => this.RaiseAndSetIfChanged(ref us, value); }
  10. public LoginPageViewModel loginPage = new LoginPageViewModel();
  11. public LoginPageViewModel LP { get => loginPage; set => loginPage = value; }
  12. public CalculatorViewModel calculator = new CalculatorViewModel();
  13. public CalculatorViewModel CP { get => calculator; set => calculator = value; }
  14. public void toCalculator()
  15. {
  16. if(LP.LogIn())
  17. {
  18. US = new Calculator();
  19. }
  20. }
  21. }
  22. }