/
oxxsnaa
/
SoftwareDevelopmentTechnology
Обзор
Документация
Войти
/
oxxsnaa
/
SoftwareDevelopmentTechnology
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
UI/CheckApplications.xaml
82 строки
4 KB
Huawei
init
15 дек 2024, 21:17
15 дек 2024, 21:17
44ddcdf
Код
Авторство
О чём код?
<Window 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:TransioClientAPI.UI" xmlns:UI="clr-namespace:TransioClientAPI.UI" x:Class="TransioClientAPI.UI.CheckApplications" mc:Ignorable="d" Title="Управление заявками (Transio)" Height="450" Width="800" MinHeight="300" MinWidth="600" Background="#E3F2FD"> <Grid Margin="10"> <!-- Определение столбцов и строк для адаптивной разметки --> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <!-- Таблица --> <DataGrid x:Name="dgApplications" Grid.Row="0" Margin="0 0 0 10" ItemsSource="{Binding AppModel.Applications, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type local:CheckApplications}, Mode=FindAncestor}}" IsReadOnly="True" AutoGenerateColumns="True" CanUserAddRows="False" HeadersVisibility="Column" BorderBrush="#2196F3" BorderThickness="1"> <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Style.Triggers> <!-- Условие для строк со статусом "Отменено" --> <DataTrigger Binding="{Binding Application.Status, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UI:CreateOrEditApplication}}}" Value="Отменено"> <Setter Property="Background" Value="White" /> </DataTrigger> <!-- Условие для строк со статусом "Завершено" --> <DataTrigger Binding="{Binding Application.Status, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UI:CreateOrEditApplication}}}" Value="Завершено"> <Setter Property="Background" Value="White" /> </DataTrigger> <!-- Условие для всех остальных статусов --> <DataTrigger Binding="{Binding Status}" Value="{x:Null}"> <Setter Property="Background" Value="#BBDEFB" /> </DataTrigger> <DataTrigger Binding="{Binding Status}" Value=""> <Setter Property="Background" Value="#BBDEFB" /> </DataTrigger> <DataTrigger Binding="{Binding Status}" Value="Открыто"> <Setter Property="Background" Value="#BBDEFB" /> </DataTrigger> </Style.Triggers> </Style> </DataGrid.RowStyle> </DataGrid> <!-- Панель кнопок --> <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center"> <Button Content="Добавить" Margin="5,0" Padding="10,5" Background="#2196F3" Foreground="White" Click="CreateApplicationButton"/> <Button Content="Удалить" Margin="5,0" Padding="10,5" Background="#2196F3" Foreground="White" Click="DeleteApplicationButton"/> <Button Content="Изменить" Margin="5,0" Padding="10,5" Background="#2196F3" Foreground="White" Click="ChangeApplicationButton"/> </StackPanel> </Grid> </Window>