wenxiangchao
4 天以前 559890c482f5973f06aafdfec9550fee5ba3c7f2
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
<pu:WindowX x:Class="Plugin.TestResult.ScannerSetting"
        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"
        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"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:ports="clr-namespace:System.IO.Ports;assembly=System"
        SizeToContent="Height"
        WindowStartupLocation="CenterOwner"
        Title="{Binding title}" Width="600">
    <Window.Resources>
        <ObjectDataProvider x:Key="stopBitsItems" 
                  MethodName="GetValues" 
                  ObjectType="{x:Type sys:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="ports:StopBits"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </Window.Resources>
 
 
    <Grid Margin="10">
        <StackPanel x:Name="formPanel">
            <pu:FormGroup x:Name="FgPortName" Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource Tr.PortName}"
              GroupName="MyFormGroup">
                <ComboBox x:Name="CbPortName" Style="{StaticResource FormComboxStyle}" />
            </pu:FormGroup>
 
            <pu:FormGroup Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource Tr.BaudRate}"
                          dp:FormGroupHelper.IsRequired="True"
                          GroupName="MyFormGroup">
                <pu:NumberInput x:Name="NiBaudRate" IsEnabled="{Binding SbIsEnabled}" Style="{StaticResource FormNumberInput}" />
            </pu:FormGroup>
 
            <pu:FormGroup Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource Tr.DataBits}"
            dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                <pu:NumberInput x:Name="NiDataBits" IsEnabled="{Binding SbIsEnabled}" Style="{StaticResource FormNumberInput}" />
            </pu:FormGroup>
 
            <pu:FormGroup Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource Tr.StopBits}" 
                          dp:FormGroupHelper.IsRequired="True" GroupName="MyFormGroup">
                <ComboBox x:Name="CbStopBits" IsEnabled="{Binding SbIsEnabled}" Style="{StaticResource FormComboxStyle}"
                          ItemsSource="{Binding Source={StaticResource stopBitsItems}}"
          SelectedValuePath="Content">
                </ComboBox>
            </pu:FormGroup>
 
            <pu:FormGroup Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource Tr.DtrEnable}" GroupName="MyFormGroup">
                <CheckBox x:Name="CxDtrEnable" IsEnabled="{Binding SbIsEnabled}"/>
            </pu:FormGroup>
 
            <pu:FormGroup Style="{StaticResource InputFormGroupStyle}" Header="{DynamicResource Tr.RtsEnable}"  GroupName="MyFormGroup">
                <CheckBox x:Name="CxRtsEnable" IsEnabled="{Binding SbIsEnabled}"/>
            </pu:FormGroup>
        </StackPanel>
    </Grid>
</pu:WindowX>