alielie
2025-11-24 9211ec11c112e18cd99e77f889a01110a70031ce
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
<UserControl x:Class="Plugin.CurrentSensorControl.BurnInCell"
             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.CurrentSensorControl"
             mc:Ignorable="d" 
             
             xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
xmlns:mdi="clr-namespace:HMI.UI.MDI;assembly=HMI.UI"
xmlns:pw="https://opensource.panuon.com/wpf"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <Style TargetType="pu:Switch">
            <Setter Property="ContentPlacement" Value="Left" />
            <Setter Property="BoxHeight" Value="16" />
            <Setter Property="CheckedBackground" Value="{StaticResource GreenVerBar}" />
            <Setter Property="Background" Value="{StaticResource DangerColor}" />
            <Setter Property="ToggleSize" Value="10" />
            <Setter Property="ToggleShadowColor" Value="{x:Null}" />
        </Style>
    </UserControl.Resources>
 
    <GroupBox Header="{Binding Header}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
 
            <pu:Switch Grid.Row="0" Grid.Column="0" CheckedContent="电源开" x:Name="powerSw" 
                       IsChecked="{Binding PowerStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                       Content="电源关"/>
 
            <pu:Switch Grid.Row="0" Grid.Column="1" CheckedContent="激活" x:Name="activationSw" 
IsChecked="{Binding ActivationStatus,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Content="未激活"/>
 
            <pu:Switch Grid.Row="1" Grid.Column="0" CheckedContent="OK亮" x:Name="okLightSw" 
                       IsChecked="{Binding OkLightOn,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Content="OK灭"/>
            
 
            <pu:Switch Grid.Row="1" Grid.Column="1" CheckedContent="NG亮" x:Name="ngLightSw" 
                       IsChecked="{Binding NgLightOn,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Content="NG灭"/>
 
            <!--<ui:LightBall Grid.Row="1" Grid.Column="0" Value="{Binding CellStatus}" Content="OK/NG状态"/>-->
 
            <!--<TextBlock Grid.Row="0" Grid.Column="0"  Text="{Binding PowerStatus}"/>
           
            <TextBlock Grid.Row="0" Grid.Column="1"  Text="{Binding ActivationStatus}"/>-->
 
            
        </Grid>
    </GroupBox>
</UserControl>