/
kochkatech
/
Queue
Обзор
Документация
Войти
/
kochkatech
/
Queue
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
src/Queue.Admin/ViewModels/ShellViewModel.cs
80 строк
2 KB
kochkareal
init: Начальная структура проекта и панель администратора
24 июл 2026, 21:42
24 июл 2026, 21:42
cd5152a
Код
Авторство
О чём код?
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Queue.Data; namespace Queue.Admin.ViewModels; // Оболочка главного окна: держит текущий раздел и переключает его по командам сайдбара. public partial class ShellViewModel : ObservableObject { private readonly QueueDbContextFactory _dbContextFactory; [ObservableProperty] private ObservableObject? currentViewModel; [ObservableProperty] private string activeSection = "Услуги"; public ShellViewModel(QueueDbContextFactory dbContextFactory) { _dbContextFactory = dbContextFactory; NavigateToServices(); } [RelayCommand] private void NavigateToServices() { ActiveSection = "Услуги"; CurrentViewModel = new ServicesViewModel(_dbContextFactory); } [RelayCommand] private void NavigateToTickets() { ActiveSection = "Талоны и очередь"; CurrentViewModel = new TicketsViewModel(_dbContextFactory); } [RelayCommand] private void NavigateToWindows() { ActiveSection = "Окна и кабинеты"; CurrentViewModel = new WindowsViewModel(_dbContextFactory); } [RelayCommand] private void NavigateToEmployees() { ActiveSection = "Сотрудники"; CurrentViewModel = new EmployeesViewModel(_dbContextFactory); } [RelayCommand] private void NavigateToSchedule() { ActiveSection = "Расписание"; CurrentViewModel = new ScheduleViewModel(_dbContextFactory); } [RelayCommand] private void NavigateToReports() { ActiveSection = "Отчёты"; CurrentViewModel = new ReportsViewModel(_dbContextFactory); } [RelayCommand] private void NavigateToOneC() { ActiveSection = "Интеграция 1С"; CurrentViewModel = new OneCIntegrationViewModel(_dbContextFactory); } [RelayCommand] private void NavigateToSettings() { ActiveSection = "Настройки"; CurrentViewModel = new SettingsViewModel(_dbContextFactory); } }