| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <Window x:Class="DeviceCenter.AddDevice"
- 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:local="clr-namespace:DeviceCenter"
- mc:Ignorable="d"
- Title="添加设备" Height="440" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
- <Window.Resources>
- <ObjectDataProvider x:Key="NameWeek" MethodName="GetNames" ObjectType="{x:Type sys:Enum}">
- <ObjectDataProvider.MethodParameters>
- <x:Type TypeName="local:DeviceType"/>
- </ObjectDataProvider.MethodParameters>
- </ObjectDataProvider>
- <local:EnumItemsSource x:Key="DeviceTypeItemsSource" Type="{x:Type local:DeviceType}"/>
- <local:EnumItemsSource x:Key="DirectionItemsSource" Type="{x:Type local:Direction}"/>
- </Window.Resources>
- <StackPanel Orientation="Vertical">
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="所在区域" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <ComboBox x:Name="cb_area" Width="150" DisplayMemberPath="name" SelectedValuePath="id" SelectionChanged="cb_area_SelectionChanged">
- </ComboBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="所在楼栋" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <ComboBox x:Name="cb_building" Width="150" DisplayMemberPath="name" SelectedValuePath="id" SelectionChanged="cb_building_SelectionChanged">
- </ComboBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="所在楼层" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <ComboBox x:Name="cb_floor" Width="150" DisplayMemberPath="name" SelectedValuePath="id">
- </ComboBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="设备类型" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <ComboBox x:Name="cb_type" Width="150" ItemsSource="{Binding Source={StaticResource DeviceTypeItemsSource}}" DisplayMemberPath="Key" SelectedValuePath="Value"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="方向" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <ComboBox x:Name="cb_dir" Width="150" ItemsSource="{Binding Source={StaticResource DirectionItemsSource}}" DisplayMemberPath="Key" SelectedValuePath="Value"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="设备名称" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <TextBox Name="tb_name" Width="150" VerticalContentAlignment="Center"></TextBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="IP地址" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <TextBox Name="tb_ip" Width="150" VerticalContentAlignment="Center"></TextBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="端口" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <TextBox Name="tb_port" Width="150" VerticalContentAlignment="Center"></TextBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="用户名" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <TextBox Name="tb_username" Width="150" VerticalContentAlignment="Center"></TextBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
- <Label Content="密码" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
- <TextBox Name="tb_password" Width="150" VerticalContentAlignment="Center"></TextBox>
- </StackPanel>
- <Button Content="添加" Width="60" Height="24" Margin="0 10 0 0" Click="Button_Click"></Button>
- </StackPanel>
- </Window>
|