wenxiangchao
2026-11-02 fe2aa4880d5c9fd88088ad0ed81ebaca05629f5f
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<pu:WindowX x:Class="HMI.ParameterManage.ParameterModal"
            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:HMI.ParameterManage"
            xmlns:pw="https://opensource.panuon.com/wpf"
            xmlns:pu="https://opensource.panuon.com/wpf-ui"
            xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
            xmlns:ui="clr-namespace:HMI.UI;assembly=HMI.UI"
            xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
            mc:Ignorable="d"
            Title="Form"
            SizeToContent="Height"
            Width="600"
            WindowStartupLocation="CenterOwner"
            Style="{StaticResource ModalWindow}"
            pu:WindowXModalDialog.OKButtonContent=
            "{Binding Converter={StaticResource lc},ConverterParameter='App.Save'}">
    <Grid Margin="10">
        <StackPanel x:Name="formPanel">
            <pu:FormGroup x:Name="FgProductName" 
                          Header="{DynamicResource Pm.Product.Name}" 
                          dp:FormGroupHelper.IsRequired="True" 
                          GroupName="MyFormGroup">
                <TextBox x:Name="TbProductName" IsReadOnly="True" Style="{StaticResource EditorTextBoxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgName"
                          dp:FormGroupHelper.ValidateMethod="ValidateName"
                          Header="{DynamicResource Pm.Parameter.Name}" 
                          dp:FormGroupHelper.IsRequired="True"  GroupName="MyFormGroup">
                <TextBox x:Name="TbName" Style="{StaticResource EditorTextBoxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgType"
                  Header="{DynamicResource Pm.Parameter.Type}" 
                  dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                <ComboBox x:Name="CbType" Style="{StaticResource FormComboxStyle}"
                          SelectionChanged="CbType_SelectionChanged"
                          SelectedValuePath="Content">
                    <ComboBoxItem>Int</ComboBoxItem>
                    <ComboBoxItem>Double</ComboBoxItem>
                    <ComboBoxItem>Bool</ComboBoxItem>
                    <ComboBoxItem>String</ComboBoxItem>
                </ComboBox>
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgIsArray" Header="IsArray" dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                <CheckBox x:Name="CbIsArray" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgValue" Style="{StaticResource RequiredInputFormGroupStyle}" 
                          Header="{DynamicResource Pm.Parameter.Value}" 
dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                <Grid>
                    <ComboBox x:Name="CbBoolValue" Style="{StaticResource FormComboxStyle}" 
                              Visibility="Collapsed"
                              SelectedValuePath="Content">
                        <ComboBoxItem>True</ComboBoxItem>
                        <ComboBoxItem>False</ComboBoxItem>
                    </ComboBox>
                    <ui:NumberInput x:Name="NiNumberValue" Visibility="Collapsed" Style="{StaticResource EditorTextBoxStyle}"/>
                    <Grid x:Name="StringValueGrid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBox x:Name="TbStringValue" Style="{StaticResource EditorTextBoxStyle}"/>
                        <Button Grid.Column="1" Click="Button_Click" Style="{StaticResource SearchButton}"/>
                    </Grid>
                </Grid>
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgUnit" Style="{StaticResource InputFormGroupStyle}" 
      Header="{DynamicResource Pm.Parameter.Unit}" 
dp:FormGroupHelper.IsRequired="False" GroupName="MyFormGroup">
                <TextBox x:Name="TbUnit" Style="{StaticResource EditorTextBoxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgDescription" Style="{StaticResource InputFormGroupStyle}" 
Header="{DynamicResource Pm.Parameter.Desc}" 
dp:FormGroupHelper.IsRequired="False" GroupName="MyFormGroup">
                <TextBox x:Name="TbDescription" Style="{StaticResource MultilineEditorTextBoxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgPGroup" Style="{StaticResource InputFormGroupStyle}" 
Header="{DynamicResource Pm.Parameter.Group}" 
dp:FormGroupHelper.IsRequired="False" GroupName="MyFormGroup">
                <!--<TextBox x:Name="TbPGroup" Style="{StaticResource EditorTextBoxStyle}" />-->
                <ComboBox x:Name="CbGroup" IsEditable="True" Style="{StaticResource FormComboxStyle}"/>
            </pu:FormGroup>
        </StackPanel>
    </Grid>
</pu:WindowX>