WarningItemCollection.xaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <UserControl x:Class="HistoryView.Controls.WarningItemCollection"
  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. d:DesignHeight="450" d:DesignWidth="800">
  10. <Grid>
  11. <Expander ExpandDirection="Down" Style="{StaticResource ExpanderStyle1}">
  12. <Expander.Header>
  13. <Border Background="#e4e4e4" Margin="4,0" CornerRadius="4">
  14. <Grid Margin="16,0">
  15. <Grid.ColumnDefinitions>
  16. <ColumnDefinition/>
  17. <ColumnDefinition Width="auto"/>
  18. </Grid.ColumnDefinitions>
  19. <local:WarningItem Alarm="{Binding ElementName=This, Path=Latest}" VerticalAlignment="Center" TextElement.FontSize="14" />
  20. <Button Grid.Column="1" Style="{StaticResource FunctionButton}" MinWidth="60" VerticalAlignment="Center" Command="{Binding ElementName=This, Path=Clear}" CommandParameter="{Binding ElementName=This, Path=Latest}" Content="{DynamicResource Clear}"/>
  21. </Grid>
  22. </Border>
  23. </Expander.Header>
  24. <ItemsControl ItemsSource="{Binding ElementName=This, Path=Alarms}">
  25. <ItemsControl.ItemTemplate>
  26. <DataTemplate>
  27. <Border Background="{StaticResource BackgroundColor}">
  28. <local:WarningItem Alarm="{Binding Value}" Margin="64,0,0,0" TextElement.FontSize="13" />
  29. </Border>
  30. </DataTemplate>
  31. </ItemsControl.ItemTemplate>
  32. <ItemsControl.ItemsPanel>
  33. <ItemsPanelTemplate>
  34. <StackPanel VerticalAlignment="Top"/>
  35. </ItemsPanelTemplate>
  36. </ItemsControl.ItemsPanel>
  37. </ItemsControl>
  38. </Expander>
  39. </Grid>
  40. </UserControl>