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
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
<UserControl x:Class="Plugin.BurnIn.Cooler"
             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:Plugin.BurnIn"
             mc:Ignorable="d" 
        xmlns:pu="https://opensource.panuon.com/wpf-ui"
             d:DesignHeight="450" d:DesignWidth="800">
    <GroupBox Header="{Binding Title}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label x:Name="label">
                <Label.Style>
                    <Style TargetType="Label">
                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        <Setter Property="VerticalContentAlignment" Value="Center"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Status}" Value="0">
                                <Setter Property="Background" Value="Gray"/>
                                <Setter Property="Content" Value="停止"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Status}" Value="1">
                                <Setter Property="Content" Value="运水中"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Status}" Value="2">
                                <Setter Property="Background" Value="Gray"/>
                                <Setter Property="Content" Value="{Binding LabelContent}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Status}" Value="3">
                                <Setter Property="Background" Value="Gray"/>
                                <Setter Property="Content" Value="测压中"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Label.Style>
            </Label>
            <StackPanel Grid.Row="1">
                <!--<Button Click="Button_Click" Style="{StaticResource PrimaryButton}" Tag="1" IsEnabled="False" Content="运水"/>-->
                <Button Click="Start_Click" Tag="2" x:Name="startBtn" Content="吹水">
                    <Button.Style>
                        <Style TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Status}" Value="2">
                                    <Setter Property="IsEnabled" Value="False"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Button.Style>
                </Button>
                <!--<Button Click="Button_Click" Style="{StaticResource PrimaryButton}" Tag="3" IsEnabled="False" Content="测压"/>-->
                <Button Click="Stop_Click" Style="{StaticResource DangerButton}" Tag="0" Content="停止" Cursor="Hand"/>
                <!--<Button.Style>
                    <Style TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
                        <Setter Property="Content" Value="手动吹水"/>
                        <Setter Property="IsEnabled" Value="False"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Status}" Value="0">
                                <Setter Property="Content" Value="手动吹水"/>
                                <Setter Property="IsEnabled" Value="True"/>
                                <Setter Property="Background" Value="{DynamicResource SuccessColor}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Status}" Value="2">
                                <Setter Property="Content" Value="停止吹水"/>
                                <Setter Property="IsEnabled" Value="True"/>
                                <Setter Property="Background" Value="{DynamicResource DangerColor}"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>-->
            </StackPanel>
        </Grid>
    </GroupBox>
</UserControl>