alielie
7 天以前 e57938fbda9bff702004038f76d009422968bff5
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
<UserControl x:Class="DeviceService.CanDeviceConfigControl"
             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:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:dm="clr-namespace:DeviceService.Core;assembly=DeviceService.Core"
             mc:Ignorable="d"
             d:DesignHeight="220" d:DesignWidth="420">
    <UserControl.Resources>
        <ObjectDataProvider x:Key="AccessTypeValues" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="dm:AccessType" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </UserControl.Resources>
   <Grid VerticalAlignment="Top">
        <StackPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
 
                <TextBlock Grid.Row="0" Grid.Column="0" Text="ID" VerticalAlignment="Center" Foreground="{StaticResource TextSecondaryBrush}" Margin="0,6" />
                <TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource InputTextBox}" 
                         Text="{Binding DeviceId, UpdateSourceTrigger=PropertyChanged}" Margin="0,4" />
 
                <TextBlock Grid.Row="2" Grid.Column="0" Text="品牌" VerticalAlignment="Center" Foreground="{StaticResource TextSecondaryBrush}" Margin="0,6" />
                <TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource InputTextBox}" 
                         Text="{Binding Brand, UpdateSourceTrigger=PropertyChanged}" Margin="0,4" />
 
                <TextBlock Grid.Row="3" Grid.Column="0" Text="连接端点" VerticalAlignment="Center" Foreground="{StaticResource TextSecondaryBrush}" Margin="0,6" />
                <TextBox Grid.Row="3" Grid.Column="1" Style="{StaticResource InputTextBox}" 
                         Text="{Binding ConnectStr, UpdateSourceTrigger=PropertyChanged}" Margin="0,4" />
 
                <TextBlock Grid.Row="4" Grid.Column="0" Text="访问类型" VerticalAlignment="Center" Foreground="{StaticResource TextSecondaryBrush}" Margin="0,6" />
                <ComboBox Grid.Row="4" Grid.Column="1" Margin="0,4"
                          Padding="8,6"
                          ItemsSource="{Binding Source={StaticResource AccessTypeValues}}"
                          SelectedItem="{Binding AccessType, Mode=TwoWay}" />
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>