alielie
2026-06-04 771a0e7b6b1276087515bbe94de28358cb92963b
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
96
97
98
99
100
101
102
103
104
105
106
107
<pu:WindowX x:Class="HMI.MenuManage.MenuModal"
            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.MenuManage"
            xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
            xmlns:pw="https://opensource.panuon.com/wpf"
            xmlns:pu="https://opensource.panuon.com/wpf-ui"
            mc:Ignorable="d"
            Title="Form"
            SizeToContent="Height"
            Width="600"
            Style="{StaticResource ModalWindow}"
            WindowStartupLocation="CenterOwner"
            Foreground="Black"
            >
    <Grid Margin="10">
        <StackPanel x:Name="formPanel">
            <pu:FormGroup x:Name="FgCode" Style="{StaticResource InputFormGroupStyle}" 
                          dp:FormGroupHelper.ValidateMethod="ValidateCode"
                  Header="{DynamicResource HMI.Menu.Code}"
                  dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                <TextBox x:Name="TbCode" Style="{StaticResource EditorTextBoxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgName" Style="{StaticResource InputFormGroupStyle}"
                          Header="{DynamicResource HMI.Menu.Name}" GroupName="MyFormGroup"
                          dp:FormGroupHelper.IsRequired="True" 
dp:FormGroupHelper.ValidateMethod="ValidateName">
                <TextBox x:Name="TbName" Style="{StaticResource EditorTextBoxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgIcon" Style="{StaticResource InputFormGroupStyle}"
                          Header="{DynamicResource HMI.Menu.Icon}" GroupName="MyFormGroup">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="30" />
                    </Grid.ColumnDefinitions>
                    <TextBox x:Name="TbIcon" IsReadOnly="True" FontFamily="{StaticResource iconfont}" Style="{StaticResource EditorTextBoxStyle}" />
                    <Button Grid.Column="1" BorderThickness="0,1,1,1" Style="{StaticResource SearchButton}"
                            Click="IconSelect_Click"/>
                </Grid>
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgLevel" Style="{StaticResource InputFormGroupStyle}"
                          Header="{DynamicResource HMI.Menu.Level}" 
                          dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                <ComboBox x:Name="TbLevel" Style="{StaticResource FormComboxStyle}"
                          SelectionChanged="TbLevel_SelectionChanged">
                    <ComboBoxItem>1</ComboBoxItem>
                    <ComboBoxItem>2</ComboBoxItem>
                </ComboBox>
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgType"
  Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource HMI.Menu.Type}" GroupName="MyFormGroup">
                <ComboBox x:Name="TbType" Style="{StaticResource FormComboxStyle}">
                    <ComboBoxItem>Permission</ComboBoxItem>
                    <ComboBoxItem>WPF</ComboBoxItem>
                    <ComboBoxItem>WinForm</ComboBoxItem>
                    <ComboBoxItem>LV</ComboBoxItem>
                </ComboBox>
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgParentCode" Style="{StaticResource InputFormGroupStyle}" 
                          Header="{DynamicResource HMI.Menu.ParentName}" GroupName="MyFormGroup">
                <!--<Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="30" />
                    </Grid.ColumnDefinitions>
                    <TextBox x:Name="TbParentCode" Style="{StaticResource EditorTextBoxStyle}" />
                    <Button Grid.Column="1" Style="{StaticResource SearchButton}"/>
                </Grid>-->
                <ComboBox x:Name="TbParentCode" Style="{StaticResource FormComboxStyle}" 
                          DisplayMemberPath="Name"
                          SelectedValuePath="Code"
                          ItemsSource="{Binding ParentSource}"
                          ></ComboBox>
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgDllPath" Style="{StaticResource InputFormGroupStyle}" 
                          Header="{DynamicResource HMI.Menu.DllPath}" GroupName="MyFormGroup">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="30" />
                    </Grid.ColumnDefinitions>
                    <TextBox x:Name="TbDllPath" IsReadOnly="True" Style="{StaticResource EditorTextBoxStyle}" />
                    <Button Grid.Column="1" Click="DllSelect_Click" Style="{StaticResource SearchButton}"/>
                </Grid>
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgClassName" Style="{StaticResource InputFormGroupStyle}" 
                          Header="{DynamicResource HMI.Menu.ClassName}" GroupName="MyFormGroup">
                <TextBox x:Name="TbClassName" Style="{StaticResource EditorTextBoxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup x:Name="FgSort" Style="{StaticResource InputFormGroupStyle}" 
              Header="{DynamicResource HMI.Menu.Sort}" GroupName="MyFormGroup">
                <pu:NumberInput x:Name="NiSort" Style="{StaticResource FormNumberInput}" />
            </pu:FormGroup>
        </StackPanel>
    </Grid>
</pu:WindowX>