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
53
54
55
56
<Window x:Class="DeviceService.AddDeviceWindow"
        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"
        mc:Ignorable="d"
        Title="添加设备"
        Width="480" Height="440"
        MinWidth="420" MinHeight="360"
        WindowStartupLocation="CenterOwner"
        ResizeMode="CanResize"
        Background="{StaticResource PageBackgroundBrush}">
    <Grid Margin="12">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
 
        <!-- 设备类型选择 -->
        <Border Grid.Row="0" Style="{StaticResource CardBorder}" Padding="10">
            <StackPanel>
                <TextBlock Text="设备类型"
                           Style="{StaticResource TitleText}"
                           Margin="2,0,0,8" />
                <ComboBox x:Name="TypeCombo"
                          Padding="8,6"
                          SelectionChanged="TypeCombo_SelectionChanged" />
            </StackPanel>
        </Border>
 
        <!-- 选型后加载的配置控件 -->
        <Border Grid.Row="1" Style="{StaticResource CardBorder}" Margin="0,10,0,0">
            <ContentControl x:Name="ControlHost" Margin="4" Focusable="False" />
        </Border>
 
        <!-- 底部按钮 -->
        <StackPanel Grid.Row="2"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right"
                    Margin="0,10,0,0">
            <Button x:Name="OkButton"
                    Style="{StaticResource PrimaryButton}"
                    MinWidth="88"
                    Content="确定"
                    IsEnabled="False"
                    Click="OkButton_Click" />
            <Button x:Name="CancelButton"
                    Style="{StaticResource SecondaryButton}"
                    MinWidth="88"
                    Margin="8,0,0,0"
                    Content="取消"
                    Click="CancelButton_Click" />
        </StackPanel>
    </Grid>
</Window>