schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
108
109
110
<Window x:Class="XHandler.View.Device.DeviceMethodParameters"
        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:XHandler.View"
        xmlns:str="clr-namespace:XHandler.Properties"
        xmlns:ctrls="clr-namespace:XHandler.Controls"
        xmlns:page="clr-namespace:XHandler.View.Page"
        mc:Ignorable="d" WindowStartupLocation = "CenterOwner"
        Width="956" Height="490" WindowStyle="None" AllowsTransparency="True" ResizeMode="NoResize" Background="#00FFFFFF"
        Loaded="Window_Loaded" PreviewKeyDown="Window_PreviewKeyDown">
 
    <Grid>
        <Border Background="{DynamicResource blueBrush}" CornerRadius="10 10 10 10" BorderThickness="2" BorderBrush="{DynamicResource blueBrush}">
            <Grid Margin="1.5,0,1.5,1.5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="40"/>
                </Grid.RowDefinitions>
                <Grid Grid.Row="0" MouseDown="Grid_MouseDown">
                    <Border Background="{DynamicResource blueBrush}" CornerRadius="10 10 0 0" BorderThickness="0">
                        <Grid>
                            <!--title-->
                            <TextBlock Text="设备方法参数列表" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0" FontSize="20"
                                       Foreground="White" FontWeight="Bold"/>
                            <Button Content="×" x:Name="btnClose" HorizontalAlignment="Right" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="10 0" FontSize="28" Width="40" Height="40"
                                    FontWeight="Bold" Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Visibility="Visible" Click="btnClose_Click"/>
                        </Grid>
                    </Border>
                </Grid>
 
                <Grid Grid.Row="1" Background="White" Height="480">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="10"/>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="50"/>
                        <RowDefinition Height="83*"/>
                        <RowDefinition Height="2*"/>
                    </Grid.RowDefinitions>
 
                    <Grid Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="240"/>
                            <ColumnDefinition Width="400"/>
                        </Grid.ColumnDefinitions>
 
                        <!--搜索框: 参数名称-->
                        <ctrls:SearchTextBox x:Name="searchParametersName" Grid.Row="0" Grid.Column="0"
                                             Background="{DynamicResource middleGrayBrush}" Watermark="{x:Static str:Resources.strInputParametersName}" 
                                             VerticalAlignment="Center" FontSize="16" VerticalContentAlignment="Center" Height="30" Width="220" 
                                             HorizontalAlignment="Left" Margin="25,0,0,0"/>
 
                        <!--搜索按钮-->
                        <Button x:Name="btnSearch" Grid.Row="0" Grid.Column="1" Content="搜索" Width="80" Height="30" VerticalContentAlignment="Center"
                                    HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="20,0,0,0" FontSize="16" Style="{DynamicResource BlueButtonStyle}" 
                                    Background="{DynamicResource blueBrush}" Click="btnSearch_Click"/>
 
                        <!--添加方法参数-->
                        <Button x:Name="btnAddMethodParameters" Grid.Column="1" Content="{x:Static str:Resources.strAddMethodParameters}" Width="114" Height="30" VerticalContentAlignment="Center"
                                    HorizontalAlignment="Left" VerticalAlignment="Center" Margin="150,0,0,0" FontSize="16" Style="{DynamicResource BlueButtonStyle}" 
                                    Background="{DynamicResource blueBrush}" Click="btnAddMethodParameters_Click"/>
                    </Grid>
 
                    <page:PagerToolsControl Grid.Row="2" x:Name="pagerToolsControl_paging" VerticalAlignment="Top" Margin="15,20,0,0" 
                                                PageCntChanged="pagerToolsControl_paging_PageCntChanged" OnePageRowCntChanged="pagerToolsControl_paging_OnePageRowCntChanged"/>
 
                    <DataGrid Grid.Row="3" x:Name="dgMethodParametersData" AutoGenerateColumns="False" BorderThickness="0" FontSize="16" 
                                  RowHeaderWidth="0" BorderBrush="LightGray" CanUserResizeColumns="True" CanUserResizeRows="False" Margin="20,20,20,12" Background="White"
                                  CanUserSortColumns="False" CanUserReorderColumns="False" CanUserAddRows="False" ColumnHeaderStyle="{DynamicResource dataGridColumnHeaderStyle}"
                                  GridLinesVisibility="None" IsReadOnly="True" RowStyle="{StaticResource dataGridRowStyle}" CellStyle="{StaticResource dataGridCellStyleDoubleClick}">
 
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="80" Binding="{Binding SId}" Header="序号" />
                            <DataGridTextColumn Width="80" Binding="{Binding Sort}" Header="排序号" />
                            <DataGridTextColumn Width="100" Binding="{Binding TypeName}" Header="类别" />
                            <DataGridTextColumn Width="180" Binding="{Binding Name}" Header="参数中文名称" />
                            <DataGridTextColumn Width="180" Binding="{Binding ParameterName}" Header="参数英文名称" />
                            <DataGridTextColumn Width="80" Binding="{Binding Value}" Header="值" />
 
                            <!--#region 操作-->
                            <DataGridTemplateColumn Header="{x:Static str:Resources.strOperation}" Width="*" >
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <!--修改-->
                                            <Button x:Name="btnEdit" Content="修改" Width="45" Height="25" Style="{DynamicResource LinkButton}"
                                                            Tag="{Binding Id}" Foreground="{DynamicResource blueBrush}" Click="btnMethodParametersEdit_Click"/>
                                            <!--删除-->
                                            <Button x:Name="btnDelete" Content="删除" Width="45" Height="25" Style="{DynamicResource LinkButton}"
                                                            Tag="{Binding Id}" Foreground="{DynamicResource blueBrush}" Click="btnMethodParametersDelete_Click"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
 
                <!--<Button Grid.Row="1" x:Name="btnCancel" Content="取消" Width="80" Height="40" VerticalContentAlignment="Center"
                    HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" Style="{DynamicResource BlueButtonStyle}" 
                    Background="{DynamicResource blueBrush}" Click="btnCancel_Click" Margin="450,500,0,0"/>-->
            </Grid>
        </Border>
    </Grid>
</Window>