-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServiceManagementWindow.xaml
More file actions
189 lines (174 loc) · 10.6 KB
/
Copy pathServiceManagementWindow.xaml
File metadata and controls
189 lines (174 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<Window x:Class="MyPanelCarWashing.ServiceManagementWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MyPanelCarWashing"
mc:Ignorable="d"
Title="Управление услугами"
WindowStartupLocation="CenterScreen"
ResizeMode="CanResize"
MinWidth="1000" MinHeight="500"
Background="#F5F6FA"
BorderBrush="Black"
BorderThickness="1"
WindowStyle="None"
WindowState="Maximized">
<Window.Resources>
<local:SafePriceConverter x:Key="SafePriceConverter"/>
<local:ActiveToBackgroundConverter x:Key="ActiveToBackgroundConverter"/>
<local:ActiveToStatusConverter x:Key="ActiveToStatusConverter"/>
<local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
<local:ZeroToVisibilityConverter x:Key="ZeroToVisibilityConverter"/>
<local:StatusToBackgroundConverter x:Key="StatusToBackgroundConverter"/>
<!-- Стиль для карточки услуги в ListBox -->
<Style x:Key="ServiceCardStyle" TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="CardBorder"
BorderThickness="1" BorderBrush="#BDC3C7" CornerRadius="8"
Background="White" Width="280" MinHeight="180" Margin="8"
HorizontalAlignment="Center"
Cursor="Hand">
<Border.Effect>
<DropShadowEffect BlurRadius="3" ShadowDepth="1" Opacity="0.2"/>
</Border.Effect>
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="CardBorder" Property="BorderBrush" Value="#2196F3"/>
<Setter TargetName="CardBorder" Property="BorderThickness" Value="3"/>
<Setter TargetName="CardBorder" Property="Background" Value="#E3F2FD"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="CardBorder" Property="BorderBrush" Value="#3498DB"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="🛠️ Управление услугами" FontSize="24" FontWeight="Bold"
Foreground="#2C3E50" HorizontalAlignment="Center" Margin="0,0,0,15"/>
<!-- Кнопки управления и поиск -->
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,10"
HorizontalAlignment="Left" VerticalAlignment="Center">
<Button Content="➕ Добавить услугу" Click="AddButton_Click" Width="140" Height="35"
Margin="5" Background="#27AE60" Foreground="White"/>
<Button Content="✏ Редактировать" Click="EditButton_Click" Width="140" Height="35"
Margin="5" Background="#3498DB" Foreground="White"/>
<Button Content="🗑️ Удалить" Click="DeleteButton_Click" Width="100" Height="35"
Margin="5" Background="#E74C3C" Foreground="White"/>
<Button Content="🔄 Обновить" Click="RefreshButton_Click" Width="100" Height="35"
Margin="5" Background="#95A5A6" Foreground="White"/>
<Label Content="🔍 Поиск:" VerticalContentAlignment="Center" Margin="20,0,0,0"/>
<TextBox x:Name="SearchTextBox" Width="350" Height="50" Margin="5" Padding="5"
TextChanged="SearchTextBox_TextChanged"/>
</StackPanel>
<!-- Список услуг на ListBox с карточками -->
<ListBox x:Name="ServicesListBox"
Grid.Row="2"
Background="Transparent"
BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectionMode="Single"
Margin="5"
HorizontalContentAlignment="Center"
MouseLeftButtonDown="ServicesListBox_MouseLeftButtonDown"
MouseDoubleClick="ServicesListBox_MouseDoubleClick">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Top"
IsItemsHost="True"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<StaticResource ResourceKey="ServiceCardStyle"/>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="10" ContextMenuService.IsEnabled="True" Width="280">
<Grid.ContextMenu>
<ContextMenu>
<MenuItem Header="✏ Редактировать" Click="EditMenuItem_Click"/>
<MenuItem Header="🗑️ Удалить" Click="DeleteMenuItem_Click"/>
<Separator/>
<MenuItem Header="📋 Копировать название" Click="CopyNameMenuItem_Click"/>
</ContextMenu>
</Grid.ContextMenu>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" FontSize="16" FontWeight="Bold"
Text="{Binding Name}" HorizontalAlignment="Center"
Foreground="#2C3E50" TextWrapping="Wrap" TextAlignment="Center"/>
<StackPanel Grid.Row="1" Margin="0,10,0,0">
<TextBlock FontSize="11" Foreground="#27AE60" HorizontalAlignment="Center">
<TextBlock.Text>
<MultiBinding StringFormat="Седан: {0:N0}₽">
<Binding Path="PriceByBodyType" ConverterParameter="1" Converter="{StaticResource SafePriceConverter}"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock FontSize="10" Foreground="#7F8C8D" HorizontalAlignment="Center">
<TextBlock.Text>
<MultiBinding StringFormat="Хэтчбек: {0:N0}₽">
<Binding Path="PriceByBodyType" ConverterParameter="2" Converter="{StaticResource SafePriceConverter}"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock FontSize="10" Foreground="#7F8C8D" HorizontalAlignment="Center">
<TextBlock.Text>
<MultiBinding StringFormat="Универсал: {0:N0}₽">
<Binding Path="PriceByBodyType" ConverterParameter="3" Converter="{StaticResource SafePriceConverter}"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock FontSize="10" Foreground="#7F8C8D" HorizontalAlignment="Center">
<TextBlock.Text>
<MultiBinding StringFormat="Внедорожник: {0:N0}₽">
<Binding Path="PriceByBodyType" ConverterParameter="4" Converter="{StaticResource SafePriceConverter}"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
<TextBlock Grid.Row="2" FontSize="11"
Text="{Binding DurationMinutes, StringFormat=⏱️ Длительность: {0} мин}"
HorizontalAlignment="Center" Margin="0,5,0,0"
Foreground="#7F8C8D"/>
<TextBlock Grid.Row="3" FontSize="11"
Text="{Binding Description}"
HorizontalAlignment="Center" Margin="0,5,0,0"
Foreground="#95A5A6" TextWrapping="Wrap" TextAlignment="Center"
MaxHeight="50"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- Кнопка закрытия -->
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10">
<Button Content="🔧 Проверить" Click="CheckIntegrityButton_Click" Width="130" Height="35"
Margin="5" Background="#F39C12" Foreground="White"/>
<Button Content="✖ Закрыть" Click="CloseButton_Click" Width="100" Height="35"
Margin="5" Background="#E74C3C" Foreground="White"/>
</StackPanel>
</Grid>
</Window>