/
kochkatech
/
Queue
Обзор
Документация
Войти
/
kochkatech
/
Queue
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
dev
src/Queue.Admin/MainWindow.xaml
132 строки
8 KB
kochkareal
feat: вкладка "Экраны" в Admin — запуск/управление табло и АРМ оператора
27 июл 2026, 21:26
27 июл 2026, 21:26
62e41f9
Код
Авторство
О чём код?
<Window x:Class="Queue.Admin.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:Queue.Admin.ViewModels" xmlns:views="clr-namespace:Queue.Admin.Views" xmlns:conv="clr-namespace:Queue.Admin.Converters" Title="Очередь — панель администратора" Height="760" Width="1200" MinHeight="640" MinWidth="1000" Background="White"> <Window.Resources> <conv:NavItemActiveConverter x:Key="NavItemActiveConverter" /> <DataTemplate DataType="{x:Type vm:TicketsViewModel}"> <views:TicketsView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:ServicesViewModel}"> <views:ServicesView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:WindowsViewModel}"> <views:WindowsView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:EmployeesViewModel}"> <views:EmployeesView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:ReportsViewModel}"> <views:ReportsView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:SettingsViewModel}"> <views:SettingsView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:ScheduleViewModel}"> <views:ScheduleView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:OneCIntegrationViewModel}"> <views:OneCIntegrationView /> </DataTemplate> <DataTemplate DataType="{x:Type vm:ScreensViewModel}"> <views:ScreensView /> </DataTemplate> <Style x:Key="NavItemStyle" TargetType="Button"> <Setter Property="Background" Value="Transparent" /> <Setter Property="Foreground" Value="White" /> <Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="Padding" Value="12,10" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" /> <!-- Свой шаблон — без него поверх Background="Transparent" всё равно рисуется системная подсветка hover (см. такой же комментарий в BrandColors.xaml). --> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Border x:Name="Bg" Background="{TemplateBinding Background}" CornerRadius="4"> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" /> </Border> <ControlTemplate.Triggers> <!-- Наведение всегда даёт одну и ту же подсветку — заметно темнее/светлее фона, независимо от того, активен ли пункт. --> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="Bg" Property="Background" Value="#40FFFFFF" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="{StaticResource FocusBrush}" /> </Trigger> </Style.Triggers> </Style> </Window.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="220" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <!-- Боковая панель: фирменные цвета КОЧКАТЕХ --> <Border Grid.Column="0" Background="{StaticResource MainBrush}"> <StackPanel> <StackPanel Margin="20,24,20,24"> <TextBlock FontSize="{StaticResource FontSizeTitle}" FontWeight="Bold"> <Run Text="КОЧКА" Foreground="White" /> <Run Text="ТЕХ" Foreground="{StaticResource FocusBrush}" /> </TextBlock> <TextBlock Text="Очередь" Foreground="White" Opacity="0.7" FontSize="{StaticResource FontSizeMedium}" Margin="0,4,0,0" /> </StackPanel> <StackPanel Margin="8,0"> <StackPanel.Resources> <!-- Общий шаблон подсветки активного пункта — Tag каждой кнопки ниже должен совпадать со строкой ActiveSection в ShellViewModel. --> <Style TargetType="Button" BasedOn="{StaticResource NavItemStyle}"> <Setter Property="Background"> <Setter.Value> <MultiBinding Converter="{StaticResource NavItemActiveConverter}"> <Binding RelativeSource="{RelativeSource Self}" Path="Tag" /> <Binding Path="ActiveSection" /> </MultiBinding> </Setter.Value> </Setter> <Setter Property="FontWeight"> <Setter.Value> <MultiBinding Converter="{StaticResource NavItemActiveConverter}" ConverterParameter="FontWeight"> <Binding RelativeSource="{RelativeSource Self}" Path="Tag" /> <Binding Path="ActiveSection" /> </MultiBinding> </Setter.Value> </Setter> </Style> </StackPanel.Resources> <Button Content="Талоны и очередь" Tag="Талоны и очередь" Command="{Binding NavigateToTicketsCommand}" /> <Button Content="Услуги" Tag="Услуги" Command="{Binding NavigateToServicesCommand}" /> <Button Content="Окна и кабинеты" Tag="Окна и кабинеты" Command="{Binding NavigateToWindowsCommand}" /> <Button Content="Сотрудники" Tag="Сотрудники" Command="{Binding NavigateToEmployeesCommand}" /> <Button Content="Расписание" Tag="Расписание" Command="{Binding NavigateToScheduleCommand}" /> <Button Content="Отчёты" Tag="Отчёты" Command="{Binding NavigateToReportsCommand}" /> <Button Content="Интеграция 1С" Tag="Интеграция 1С" Command="{Binding NavigateToOneCCommand}" /> <Button Content="Настройки" Tag="Настройки" Command="{Binding NavigateToSettingsCommand}" /> <Button Content="Экраны" Tag="Экраны" Command="{Binding NavigateToScreensCommand}" /> </StackPanel> </StackPanel> </Border> <!-- Контент --> <ContentControl Grid.Column="1" Content="{Binding CurrentViewModel}" /> </Grid> </Window>