DlgAddDevice.xaml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <Window x:Class="MV485.Dlg.DlgAddDevice"
  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:local="clr-namespace:MV485.Dlg"
  7. xmlns:local1="clr-namespace:MV485.helper"
  8. mc:Ignorable="d"
  9. Background="WhiteSmoke"
  10. WindowStartupLocation="CenterOwner"
  11. ResizeMode="NoResize"
  12. ShowInTaskbar="False"
  13. Title="添加485设备" Height="300" Width="340">
  14. <Grid Margin="10 10 10 0">
  15. <Grid.RowDefinitions>
  16. <RowDefinition Height="*" />
  17. <RowDefinition Height="40" />
  18. </Grid.RowDefinitions>
  19. <Border Grid.Row="0" BorderBrush="#D3D3D3" BorderThickness="1" Background="White">
  20. <Grid Margin="10 5 10 5">
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="*" />
  23. <RowDefinition Height="*" />
  24. <RowDefinition Height="*" />
  25. <RowDefinition Height="*" />
  26. <RowDefinition Height="*" />
  27. </Grid.RowDefinitions>
  28. <Grid.ColumnDefinitions>
  29. <ColumnDefinition Width="70" />
  30. <ColumnDefinition Width="*" />
  31. </Grid.ColumnDefinitions>
  32. <TextBlock Grid.Row="0" Grid.Column="0" Text="端口号" FontSize="14" VerticalAlignment="Center" />
  33. <ComboBox x:Name="cmbPortNames" Grid.Row="0" Grid.Column="1" Height="28"
  34. DisplayMemberPath="ModelName" SelectedValuePath="PortName"
  35. Padding="5 0 0 0" Margin="2" FontSize="13px" VerticalContentAlignment="Center"/>
  36. <TextBlock Grid.Row="1" Grid.Column="0" Text="波特率" FontSize="14" VerticalAlignment="Center" />
  37. <ComboBox x:Name="cmbBaudrate" Grid.Row="1" Grid.Column="1" Height="28"
  38. Padding="5 0 0 0" Margin="2" FontSize="13px"
  39. VerticalContentAlignment="Center"/>
  40. <TextBlock Grid.Row="2" Grid.Column="0" Text="485地址" FontSize="14" VerticalAlignment="Center" />
  41. <!--<ComboBox x:Name="cmbDevId" Width="60" Padding="5 0 0 0" Margin="0" FontSize="14"
  42. PreviewTextInput="TextBox_PreviewTextInput" VerticalContentAlignment="Center" Height="28" IsEditable="True"/>-->
  43. <local1:MultiSelectComboBox x:Name="mcmbAddress" Grid.Row="2" Grid.Column="1"
  44. Height="28" Padding="0 0 0 0" FontSize="13px" Margin="2"
  45. VerticalContentAlignment="Center" />
  46. <TextBlock Grid.Row="3" Grid.Column="0" Text="读取间隔" FontSize="14" VerticalAlignment="Center" />
  47. <Grid Margin="2" Grid.Row="3" Grid.Column="1">
  48. <Grid.ColumnDefinitions>
  49. <ColumnDefinition Width="*" />
  50. <ColumnDefinition Width="Auto" />
  51. </Grid.ColumnDefinitions>
  52. <TextBox Grid.Column="0" Name="txtReadInterval" HorizontalAlignment="Stretch" Height="28"
  53. FontSize="14px" Foreground="#000000" VerticalAlignment="Center" Padding="2"/>
  54. <TextBlock Grid.Column="1" Text="分钟" Margin="5 0 0 0" VerticalAlignment="Center" />
  55. </Grid>
  56. <StackPanel Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Orientation="Horizontal">
  57. <CheckBox x:Name="chkRun" Content="启用" FontSize="14" IsChecked="True" Margin="0 0 20 0" />
  58. <CheckBox x:Name="chkReadImage" Content="读取照片" FontSize="14" IsChecked="False" />
  59. </StackPanel>
  60. </Grid>
  61. </Border>
  62. <!-- 按钮区域 -->
  63. <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
  64. <Button Name="btnOK" Content="确定" HorizontalAlignment="Center" Margin="0 0 20 0"
  65. VerticalAlignment="Center" Width="80" Height="26" Click="BtnOK_Click" />
  66. <Button Name="btnClose" Content="取消" HorizontalAlignment="Center"
  67. VerticalAlignment="Center" Width="80" Height="26" Click="BtnClose_Click" />
  68. </StackPanel>
  69. </Grid>
  70. </Window>