123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using System.Collections.Generic;
- using Avalonia.Controls;
- using Microsoft.EntityFrameworkCore.Metadata.Internal;
- using ReactiveUI;
- namespace AvaloniaApplication1.ViewModels
- {
- public class AdminViewModel : ViewModelBase
- {
- UserControl page = new MainPage();
- bool flag = false;
- List<string> pages = ["Ñìåøàðèêè","Ïðîôèëü","Äîáàâèòü ñìåøàðèêà"];
- string selectedItem;
- public UserControl Page { get => page; set => this.RaiseAndSetIfChanged(ref page, value); }
- public List<string> Pages { get => pages; set => this.RaiseAndSetIfChanged(ref pages, value); }
- public string SelectedItem { get => selectedItem; set { selectedItem = value; navigation(); } }
- public bool Flag { get => flag; set => this.RaiseAndSetIfChanged(ref flag, value); }
- public void navigation()
- {
- if(selectedItem == "Ñìåøàðèêè")
- {
- Page = new MainPage();
- }else if(selectedItem == "Ïðîôèëü")
- {
- Page = new AdminUsers();
- }else if(selectedItem == "Äîáàâèòü ñìåøàðèêà")
- {
- Page = new AddSmesh();
- }
- }
- public void Press()
- {
- Flag = !Flag;
- }
-
- }
- }
|