wenxiangchao
2026-11-02 9d1660270272180cd71147d6ddd53d1382643d2e
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
<UserControl x:Class="Util.ManualDebug.StatusCell"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Util.ManualDebug"
        xmlns:pu="https://opensource.panuon.com/wpf-ui"
             mc:Ignorable="d" Padding="5" MaxHeight="80"
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Style>
        <Style TargetType="UserControl">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Status}" Value="{x:Static local:CellStatus.Closed}">
                    <Setter Property="Background" Value="Gray"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Status}" Value="{x:Static local:CellStatus.OK}">
                    <Setter Property="Background" Value="#2D8659"/>
                    <Setter Property="Foreground" Value="#FFF"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Status}" Value="{x:Static local:CellStatus.NG}">
                    <Setter Property="Background" Value="#C53030"/>
                    <Setter Property="Foreground" Value="#FFF"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Status}" Value="{x:Static local:CellStatus.Testing}">
                    <Setter Property="Background" Value="#3182CE"/>
                    <Setter Property="Foreground" Value="#FFF"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Style>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock FontSize="20" FontWeight="Bold" Text="{Binding Title}"/>
        <TextBlock Grid.Row="1" FontSize="18" Text="{Binding Status}"/>
    </Grid>
</UserControl>