You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 rivejä
2.6 KiB

  1. <UserControl
  2. x:Class="ModbusDemo.VIew.AttachUC"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:ModbusDemo.VIew"
  8. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  9. xmlns:viewmodel="clr-namespace:ModbusDemo.VIewModel"
  10. d:DataContext="{d:DesignInstance Type=viewmodel:AttachUCViewModel}"
  11. d:Background="White"
  12. d:DesignHeight="450"
  13. d:DesignWidth="800"
  14. mc:Ignorable="d">
  15. <UserControl.Resources>
  16. <Style TargetType="TextBox">
  17. <Setter Property="Margin" Value="0,5" />
  18. <Setter Property="FontSize" Value="14" />
  19. </Style>
  20. </UserControl.Resources>
  21. <Grid>
  22. <Grid.RowDefinitions>
  23. <RowDefinition Height="80">
  24. </RowDefinition>
  25. <RowDefinition>
  26. </RowDefinition>
  27. <RowDefinition Height="80">
  28. </RowDefinition>
  29. <RowDefinition>
  30. </RowDefinition>
  31. </Grid.RowDefinitions>
  32. <Button
  33. Width="80"
  34. Height="40"
  35. materialDesign:ButtonAssist.CornerRadius="20"
  36. Command="{Binding ReadOddRegisterCmm}"
  37. Content="读取"
  38. Style="{StaticResource MaterialDesignRaisedDarkButton}">
  39. </Button>
  40. <TextBox Grid.Row="1" Margin="5" Text="{Binding ReadResult}" Style="{StaticResource MaterialDesignOutlinedTextBox}">
  41. </TextBox>
  42. <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
  43. <TextBlock Margin="10,30,10,0" Text="写入位数:">
  44. </TextBlock>
  45. <TextBox MinWidth="80" Height="20">
  46. </TextBox>
  47. <TextBlock Margin="10,30,10,0" Text="写入数据:">
  48. </TextBlock>
  49. <TextBox MinWidth="80" Height="20" Margin="0 0 20 0">
  50. </TextBox>
  51. <Button
  52. Grid.Row="2"
  53. Width="80"
  54. Height="40"
  55. materialDesign:ButtonAssist.CornerRadius="20"
  56. Command="{Binding WriteMoreRegisterCmm}"
  57. Content="读取"
  58. Style="{StaticResource MaterialDesignRaisedDarkButton}">
  59. </Button>
  60. </StackPanel>
  61. <TextBox Grid.Row="3" Margin="5" Text="{Binding ReadResult}" Style="{StaticResource MaterialDesignOutlinedTextBox}">
  62. </TextBox>
  63. </Grid>
  64. </UserControl>