mekasu0124

Untitled

Mar 14th, 2024
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using ReactiveUI;
  2. using MakeMyProject.Services;
  3. using System.IO;
  4.  
  5. namespace MakeMyProject.ViewModels;
  6.  
  7. public class MainWindowViewModel : ViewModelBase
  8. {
  9.     ViewModelBase _content = new();
  10.  
  11.     private Helpers _hp = new();
  12.  
  13.     public MainWindowViewModel()
  14.     {
  15.         bool setup = JsonEngine.CreateSetupFile();
  16.  
  17.         if (!setup)
  18.         {
  19.             CreateNewUser();
  20.         }
  21.         else
  22.         {
  23.             // ShowLoginScreen();
  24.         }
  25.     }
  26.  
  27.     public void ShowTos()
  28.     {
  29.         var vm = new TermsOfServiceViewModel();
  30.  
  31.         Content = vm;
  32.     }
  33.  
  34.     public void CreateNewUser()
  35.     {
  36.         var vm = new CreateNewUserViewModel(_hp);
  37.  
  38.         Content = vm;
  39.     }
  40.  
  41.     public ViewModelBase Content
  42.     {
  43.         get => _content;
  44.         set => this.RaiseAndSetIfChanged(ref _content, value);
  45.     }
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment