WindturbineRealTimeAlarm.xaml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <UserControl x:Class="NEIntelligentControl2.Views.Alarm.WindturbineRealTimeAlarm"
  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.Alarm"
  7. xmlns:ib="clr-namespace:NEIntelligentControl2.Views.Basic"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
  10. <UserControl.Resources>
  11. <Style TargetType="{x:Type ScrollBar}">
  12. <Setter Property="Background" Value="#77F0F8FF"/>
  13. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
  14. <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
  15. <!--滚动条宽度-->
  16. <Setter Property="Width" Value="8"/>
  17. <Setter Property="MinWidth" Value="6"/>
  18. <Setter Property="Template">
  19. <Setter.Value>
  20. <ControlTemplate TargetType="{x:Type ScrollBar}">
  21. <!--滚动条背景色-->
  22. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true" Width="8">
  23. <Grid.RowDefinitions>
  24. <RowDefinition />
  25. </Grid.RowDefinitions>
  26. <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
  27. <Track.DecreaseRepeatButton>
  28. <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  29. </Track.DecreaseRepeatButton>
  30. <Track.IncreaseRepeatButton>
  31. <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  32. </Track.IncreaseRepeatButton>
  33. <Track.Thumb>
  34. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  35. </Track.Thumb>
  36. </Track>
  37. </Grid>
  38. <ControlTemplate.Triggers>
  39. <Trigger Property="IsEnabled" Value="false">
  40. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  41. </Trigger>
  42. </ControlTemplate.Triggers>
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. <Style.Triggers>
  47. <Trigger Property="Orientation" Value="Horizontal">
  48. <Setter Property="Width" Value="Auto"/>
  49. <Setter Property="MinWidth" Value="0"/>
  50. <Setter Property="Height" Value="6"/>
  51. <Setter Property="MinHeight" Value="6"/>
  52. <Setter Property="Background" Value="#77F0F8FF"/>
  53. <Setter Property="Template">
  54. <Setter.Value>
  55. <ControlTemplate TargetType="{x:Type ScrollBar}">
  56. <Grid x:Name="Bg" Background="Red" SnapsToDevicePixels="true">
  57. <Grid.ColumnDefinitions>
  58. <ColumnDefinition />
  59. </Grid.ColumnDefinitions>
  60. <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
  61. <Track.DecreaseRepeatButton>
  62. <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  63. </Track.DecreaseRepeatButton>
  64. <Track.IncreaseRepeatButton>
  65. <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  66. </Track.IncreaseRepeatButton>
  67. <Track.Thumb>
  68. <Thumb Style="{StaticResource ScrollBarThumb}" />
  69. </Track.Thumb>
  70. </Track>
  71. </Grid>
  72. <ControlTemplate.Triggers>
  73. <Trigger Property="IsEnabled" Value="false">
  74. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  75. </Trigger>
  76. </ControlTemplate.Triggers>
  77. </ControlTemplate>
  78. </Setter.Value>
  79. </Setter>
  80. </Trigger>
  81. </Style.Triggers>
  82. </Style>
  83. </UserControl.Resources>
  84. <Grid>
  85. <Grid.RowDefinitions>
  86. <RowDefinition/>
  87. <RowDefinition Height="Auto"/>
  88. </Grid.RowDefinitions>
  89. <DataGrid x:Name="_DGMain" SelectionUnit="CellOrRowHeader" FontSize="14" ColumnWidth="*" Background="#FFABABAB" IsReadOnly="True" AutoGenerateColumns="False" HorizontalGridLinesBrush="#FF9E9E9E" VerticalGridLinesBrush="#FF9E9E9E">
  90. <DataGrid.Columns>
  91. <DataGridTextColumn Header="时间" Binding="{Binding LatestUpdateTimeString}" Width="150"/>
  92. <DataGridTextColumn Header="设备" Binding="{Binding ObjectName}"/>
  93. <DataGridTextColumn Header="报警信息" Binding="{Binding AlertText}" MinWidth="300"/>
  94. <DataGridTextColumn Header="级别" Binding="{Binding RankString}"/>
  95. <DataGridTextColumn Header="报警类型" Binding="{Binding Category1String}"/>
  96. <DataGridTextColumn Header="停机类型"/>
  97. <DataGridTextColumn Header="故障类型"/>
  98. <DataGridTextColumn Header="故障原因"/>
  99. </DataGrid.Columns>
  100. </DataGrid>
  101. <ib:InfoBar x:Name="_IBMain" Grid.Row="1"/>
  102. </Grid>
  103. </UserControl>