AddDevice.xaml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <Window x:Class="DeviceCenter.AddDevice"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  7. xmlns:local="clr-namespace:DeviceCenter"
  8. mc:Ignorable="d"
  9. Title="添加设备" Height="440" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
  10. <Window.Resources>
  11. <ObjectDataProvider x:Key="NameWeek" MethodName="GetNames" ObjectType="{x:Type sys:Enum}">
  12. <ObjectDataProvider.MethodParameters>
  13. <x:Type TypeName="local:DeviceType"/>
  14. </ObjectDataProvider.MethodParameters>
  15. </ObjectDataProvider>
  16. <local:EnumItemsSource x:Key="DeviceTypeItemsSource" Type="{x:Type local:DeviceType}"/>
  17. <local:EnumItemsSource x:Key="DirectionItemsSource" Type="{x:Type local:Direction}"/>
  18. </Window.Resources>
  19. <StackPanel Orientation="Vertical">
  20. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  21. <Label Content="所在区域" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  22. <ComboBox x:Name="cb_area" Width="150" DisplayMemberPath="name" SelectedValuePath="id" SelectionChanged="cb_area_SelectionChanged">
  23. </ComboBox>
  24. </StackPanel>
  25. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  26. <Label Content="所在楼栋" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  27. <ComboBox x:Name="cb_building" Width="150" DisplayMemberPath="name" SelectedValuePath="id" SelectionChanged="cb_building_SelectionChanged">
  28. </ComboBox>
  29. </StackPanel>
  30. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  31. <Label Content="所在楼层" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  32. <ComboBox x:Name="cb_floor" Width="150" DisplayMemberPath="name" SelectedValuePath="id">
  33. </ComboBox>
  34. </StackPanel>
  35. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  36. <Label Content="设备类型" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  37. <ComboBox x:Name="cb_type" Width="150" ItemsSource="{Binding Source={StaticResource DeviceTypeItemsSource}}" DisplayMemberPath="Key" SelectedValuePath="Value"/>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  40. <Label Content="方向" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  41. <ComboBox x:Name="cb_dir" Width="150" ItemsSource="{Binding Source={StaticResource DirectionItemsSource}}" DisplayMemberPath="Key" SelectedValuePath="Value"/>
  42. </StackPanel>
  43. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  44. <Label Content="设备名称" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  45. <TextBox Name="tb_name" Width="150" VerticalContentAlignment="Center"></TextBox>
  46. </StackPanel>
  47. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  48. <Label Content="IP地址" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  49. <TextBox Name="tb_ip" Width="150" VerticalContentAlignment="Center"></TextBox>
  50. </StackPanel>
  51. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  52. <Label Content="端口" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  53. <TextBox Name="tb_port" Width="150" VerticalContentAlignment="Center"></TextBox>
  54. </StackPanel>
  55. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  56. <Label Content="用户名" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  57. <TextBox Name="tb_username" Width="150" VerticalContentAlignment="Center"></TextBox>
  58. </StackPanel>
  59. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  60. <Label Content="密码" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  61. <TextBox Name="tb_password" Width="150" VerticalContentAlignment="Center"></TextBox>
  62. </StackPanel>
  63. <Button Content="添加" Width="60" Height="24" Margin="0 10 0 0" Click="Button_Click"></Button>
  64. </StackPanel>
  65. </Window>