alielie
2025-04-10 6bcafc823e836ecd5790f87178a906333699f868
HMI.MenuManage/Modal/MenuModal.xaml
@@ -4,82 +4,84 @@
            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"
            BorderBrush="#3E3E45"
            BorderThickness="1"
            Foreground="Black"
            pu:WindowXCaption.Background="{StaticResource PrimaryColor}"
            pu:WindowXModalDialog.ButtonStyle="{StaticResource ModalButton}"
            pu:WindowXCaption.Foreground="#FFF"
            pu:WindowXCaption.Buttons="Close"
            pu:WindowXModalDialog.Buttons="OKCancel"
            pu:WindowXModalDialog.CancelButtonContent="取消"
            pu:WindowXModalDialog.OKButtonContent="保存"
            pu:WindowXModalDialog.ButtonPanelMargin="0,30,10,10">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
                <ResourceDictionary Source="/HMI.UI;component/Style/Colors.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
            >
    <Grid Margin="10">
        <StackPanel>
            <pu:FormGroup x:Name="FgCode" Style="{StaticResource RequiredInputFormGroupStyle}"
                  Header="菜单编号" GroupName="MyFormGroup">
        <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 RequiredInputFormGroupStyle}"
                              Header="菜单名称" GroupName="MyFormGroup">
            <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 RequiredInputFormGroupStyle}" Header="图标" GroupName="MyFormGroup">
            <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" Style="{StaticResource EditorTextBoxStyle}" />
                    <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 RequiredInputFormGroupStyle}" Header="级别" GroupName="MyFormGroup">
                <ComboBox x:Name="TbLevel" Style="{StaticResource FormComboxStyle}">
            <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 RequiredInputFormGroupStyle}" Header="类型" GroupName="MyFormGroup">
            <pu:FormGroup x:Name="FgType"
                          Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource HMI.Menu.Type}" GroupName="MyFormGroup">
                <ComboBox x:Name="TbType" Style="{StaticResource FormComboxStyle}">
                    <ComboBoxItem>WPF</ComboBoxItem>
                    <ComboBoxItem>WinForm</ComboBoxItem>
                    <ComboBoxItem>LV</ComboBoxItem>
                </ComboBox>
            </pu:FormGroup>
            <pu:FormGroup x:Name="FgParentCode" Style="{StaticResource RequiredInputFormGroupStyle}" Header="上级菜单" GroupName="MyFormGroup">
                <Grid>
            <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>
                </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 RequiredInputFormGroupStyle}" Header="Dll文件" GroupName="MyFormGroup">
            <pu:FormGroup x:Name="FgDllPath" Style="{StaticResource InputFormGroupStyle}"
                          Header="{DynamicResource HMI.Menu.DllPath}" GroupName="MyFormGroup">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
@@ -90,9 +92,15 @@
                </Grid>
            </pu:FormGroup>
            <pu:FormGroup x:Name="FgClassName" Style="{StaticResource RequiredInputFormGroupStyle}" Header="类名" GroupName="MyFormGroup">
            <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>