PointDetails.xaml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <UserControl x:Class="NEIntelligentControl2.Views.Infos.PointDetails"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:NEIntelligentControl2.Views.Infos"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800" Unloaded="UserControl_Unloaded" Loaded="UserControl_Loaded">
  9. <UserControl.Resources>
  10. <Style TargetType="{x:Type ScrollBar}">
  11. <Setter Property="Background" Value="#77F0F8FF"/>
  12. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
  13. <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
  14. <!--滚动条宽度-->
  15. <Setter Property="Width" Value="8"/>
  16. <Setter Property="MinWidth" Value="6"/>
  17. <Setter Property="Template">
  18. <Setter.Value>
  19. <ControlTemplate TargetType="{x:Type ScrollBar}">
  20. <!--滚动条背景色-->
  21. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true" Width="8">
  22. <Grid.RowDefinitions>
  23. <RowDefinition />
  24. </Grid.RowDefinitions>
  25. <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
  26. <Track.DecreaseRepeatButton>
  27. <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  28. </Track.DecreaseRepeatButton>
  29. <Track.IncreaseRepeatButton>
  30. <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  31. </Track.IncreaseRepeatButton>
  32. <Track.Thumb>
  33. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  34. </Track.Thumb>
  35. </Track>
  36. </Grid>
  37. <ControlTemplate.Triggers>
  38. <Trigger Property="IsEnabled" Value="false">
  39. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  40. </Trigger>
  41. </ControlTemplate.Triggers>
  42. </ControlTemplate>
  43. </Setter.Value>
  44. </Setter>
  45. <Style.Triggers>
  46. <Trigger Property="Orientation" Value="Horizontal">
  47. <Setter Property="Width" Value="Auto"/>
  48. <Setter Property="MinWidth" Value="0"/>
  49. <Setter Property="Height" Value="6"/>
  50. <Setter Property="MinHeight" Value="6"/>
  51. <Setter Property="Background" Value="#77F0F8FF"/>
  52. <Setter Property="Template">
  53. <Setter.Value>
  54. <ControlTemplate TargetType="{x:Type ScrollBar}">
  55. <Grid x:Name="Bg" Background="Red" SnapsToDevicePixels="true">
  56. <Grid.ColumnDefinitions>
  57. <ColumnDefinition />
  58. </Grid.ColumnDefinitions>
  59. <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
  60. <Track.DecreaseRepeatButton>
  61. <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  62. </Track.DecreaseRepeatButton>
  63. <Track.IncreaseRepeatButton>
  64. <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  65. </Track.IncreaseRepeatButton>
  66. <Track.Thumb>
  67. <Thumb Style="{StaticResource ScrollBarThumb}" />
  68. </Track.Thumb>
  69. </Track>
  70. </Grid>
  71. <ControlTemplate.Triggers>
  72. <Trigger Property="IsEnabled" Value="false">
  73. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  74. </Trigger>
  75. </ControlTemplate.Triggers>
  76. </ControlTemplate>
  77. </Setter.Value>
  78. </Setter>
  79. </Trigger>
  80. </Style.Triggers>
  81. </Style>
  82. </UserControl.Resources>
  83. <Grid>
  84. <Grid.RowDefinitions>
  85. <RowDefinition Height="Auto"/>
  86. <RowDefinition/>
  87. </Grid.RowDefinitions>
  88. <Grid.ColumnDefinitions>
  89. <ColumnDefinition/>
  90. <ColumnDefinition/>
  91. </Grid.ColumnDefinitions>
  92. <StackPanel Orientation="Horizontal" Margin="5,0,5,5">
  93. <TextBlock Text="测点查询:" VerticalAlignment="Center"/>
  94. <TextBox x:Name="_TBSerach" MinWidth="200" KeyDown="TextBox_KeyDown" VerticalAlignment="Center" />
  95. <Button Content="查 询" Click="Button_Click" Padding="12,3" Tag="ok" Style="{StaticResource ConfirmButtonStyle}"/>
  96. </StackPanel>
  97. <DataGrid x:Name="_DGAI" Grid.Row="1" AutoGenerateColumns="False" ColumnWidth="*" FontSize="14" IsReadOnly="True" HorizontalGridLinesBrush="#FF9E9E9E" VerticalGridLinesBrush="#FF9E9E9E">
  98. <DataGrid.Columns>
  99. <DataGridTextColumn Header="测点名称" Binding="{Binding PointName}"/>
  100. <DataGridTextColumn Header="测点值" Binding="{Binding PointValue}"/>
  101. </DataGrid.Columns>
  102. </DataGrid>
  103. <DataGrid x:Name="_DGDI" Grid.Row="1" Grid.Column="1" ColumnWidth="*" AutoGenerateColumns="False" FontSize="14" IsReadOnly="True" HorizontalGridLinesBrush="#FF9E9E9E" VerticalGridLinesBrush="#FF9E9E9E">
  104. <DataGrid.Columns>
  105. <DataGridTextColumn Header="测点名称" Binding="{Binding PointName}"/>
  106. <DataGridTextColumn Header="测点值" Binding="{Binding PointValue}"/>
  107. </DataGrid.Columns>
  108. </DataGrid>
  109. </Grid>
  110. </UserControl>