using Avalonia.Controls; using Avalonia.Media; using LoginGenerator.Models; using ReactiveUI; using System; using System.IO; using System.Linq; namespace LoginGenerator.ViewModels { public class MainWindowViewModel : ViewModelBase { UserControl us = new GeneratePage(); public UserControl US { get => us; set => this.RaiseAndSetIfChanged(ref us, value); } DataOutputViewModel dataOutput = new DataOutputViewModel(); public DataOutputViewModel DataOutputVM { get => dataOutput; set => dataOutput = value; } GeneratePageViewModel generatePage = new GeneratePageViewModel(); public GeneratePageViewModel GeneratePageVM { get => generatePage; set => generatePage = value; } public void ViewUsersData() { US = new DataOutput(); DataOutputVM.FillingUsersList(); DataOutputVM.Userss = DataOutputVM.Userss.OrderByDescending(x=>x.DateReg).ToList(); if(GeneratePageVM.Theme == true) { DataOutputVM.Background = new SolidColorBrush(Color.FromRgb(80, 80, 80)); DataOutputVM.Background2 = new SolidColorBrush(Color.FromRgb(128, 128, 128)); } else { DataOutputVM.Background = new SolidColorBrush(Color.FromRgb(248, 244, 255)); DataOutputVM.Background2 = new SolidColorBrush(Color.FromRgb(236, 233, 255)); } } public void ViewGeneratePage() { US = new GeneratePage(); } } }