alielie
2025-03-11 2e54b439c64e0adbb7e010243c1f33aa5fc5f503
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
<pu:WindowX x:Class="Plugin.TestResult_WPF.Scanner"
        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:Plugin.TestResult_WPF"
        WindowStartupLocation="CenterScreen"
        Closing="Window_Closing"
        mc:Ignorable="d"
            Style="{StaticResource ModalWindow}"
        
             xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
             xmlns:uic="clr-namespace:HMI.UI.Converter;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"
             xmlns:cc="clr-namespace:HMI.Core;assembly=HMI.Core"
            InteropOwnersMask="False"
            
            pu:WindowXModalDialog.Buttons="{x:Null}"
        Title="{Binding title}" Height="300" Width="600">
    <Window.Resources>
        <local:FontSizeConverter x:Key="FontSizeConverter"/>
        <Style TargetType="Label">
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=Window}, 
Converter={StaticResource FontSizeConverter}, ConverterParameter='80,1920'}" />
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=Window}, 
Converter={StaticResource FontSizeConverter}, ConverterParameter='100,1920'}" />
        </Style>
        <Style TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
            <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=Window}, 
Converter={StaticResource FontSizeConverter}, ConverterParameter='100,1920'}" />
        </Style>
    </Window.Resources>
 
    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
 
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Padding="0"
               Content="{Binding Converter={StaticResource lc},ConverterParameter='Tr.PleaseScanSnr'}"
               Margin="0,0,0,20"
               />
        <StackPanel Grid.Row="1">
            <pu:FormGroup 
                dp:FormGroupHelper.IsRequired="True"
                Header="{Binding Converter={StaticResource lc},ConverterParameter='Tr.PositionSnr'}">
                <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="positionText" TextWrapping="NoWrap"/>
            </pu:FormGroup>
 
            <pu:FormGroup 
                dp:FormGroupHelper.IsRequired="True"
                Header="{Binding Converter={StaticResource lc},ConverterParameter='Tr.ProductSnr'}">
                <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="snrText" TextWrapping="NoWrap"/>
            </pu:FormGroup>
        </StackPanel>
 
        <StackPanel Style="{StaticResource ButtonGroup}" 
                    dp:StackPanelHelper.ChildSpace="50"
                    HorizontalAlignment="Center" Grid.Row="2">
            <Button Click="Con_Click" 
                    Content="{Binding Converter={StaticResource lc},ConverterParameter='Tr.ContinueScan'}"/>
            <Button Click="Ok_Click" 
                    Content="{Binding Converter={StaticResource lc},ConverterParameter='Tr.FinishScan'}"/>
        </StackPanel>
    </Grid>
</pu:WindowX>