HisProgressBar.xaml 1.5 KB

123456789101112131415161718192021222324252627282930
  1. <UserControl x:Class="HistoryView.Controls.HisProgressBar"
  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:HistoryView.Controls"
  7. mc:Ignorable="d"
  8. x:Name="This">
  9. <Border x:Name="bor" BorderBrush="Gray" BorderThickness="1" CornerRadius="0">
  10. <ItemsControl ItemsSource="{Binding ElementName=This, Path=RealtimeData}" >
  11. <ItemsControl.ItemTemplate>
  12. <DataTemplate>
  13. <ProgressBar Orientation="Vertical" Value="{Binding Value}" Width="4" Margin="-1,0,0,0" ToolTip="{Binding Value}"
  14. Maximum="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:HisProgressBar}}, Path=MaxValue}"
  15. Foreground="{Binding Bursh}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent"/>
  16. </DataTemplate>
  17. </ItemsControl.ItemTemplate>
  18. <ItemsControl.ItemsPanel>
  19. <ItemsPanelTemplate>
  20. <UniformGrid Rows="1"/>
  21. </ItemsPanelTemplate>
  22. </ItemsControl.ItemsPanel>
  23. </ItemsControl>
  24. </Border>
  25. </UserControl>