AddDevice.xaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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:my="clr-namespace:DeviceCenter.utils"
  7. mc:Ignorable="d"
  8. Title="添加设备" Height="400" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
  9. <StackPanel Orientation="Vertical">
  10. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  11. <Label Content="所在区域" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  12. <ComboBox x:Name="cb_area" Width="150" DisplayMemberPath="name" SelectedValuePath="id" SelectionChanged="cb_area_SelectionChanged">
  13. </ComboBox>
  14. </StackPanel>
  15. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  16. <Label Content="所在楼栋" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  17. <ComboBox x:Name="cb_building" Width="150" DisplayMemberPath="name" SelectedValuePath="id" SelectionChanged="cb_building_SelectionChanged">
  18. </ComboBox>
  19. </StackPanel>
  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_floor" Width="150" DisplayMemberPath="name" SelectedValuePath="id">
  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_type" Width="150" ItemsSource="{Binding Source={my:EnumerationExtension {x:Type my:Device.Type}}}" />
  28. </StackPanel>
  29. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  30. <Label Content="设备名称" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  31. <TextBox Name="tb_name" Width="150" VerticalContentAlignment="Center"></TextBox>
  32. </StackPanel>
  33. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  34. <Label Content="IP地址" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  35. <TextBox Name="tb_ip" Width="150" VerticalContentAlignment="Center"></TextBox>
  36. </StackPanel>
  37. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  38. <Label Content="端口" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  39. <TextBox Name="tb_port" Width="150" VerticalContentAlignment="Center"></TextBox>
  40. </StackPanel>
  41. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  42. <Label Content="用户名" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  43. <TextBox Name="tb_username" Width="150" VerticalContentAlignment="Center"></TextBox>
  44. </StackPanel>
  45. <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
  46. <Label Content="密码" Width="80" HorizontalContentAlignment="Right" Margin="0 0 10 0"/>
  47. <TextBox Name="tb_password" Width="150" VerticalContentAlignment="Center"></TextBox>
  48. </StackPanel>
  49. <Button Content="添加" Width="60" Height="24" Margin="0 10 0 0" Click="Button_Click"></Button>
  50. </StackPanel>
  51. </Window>