DashBoardMain.xaml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <UserControl x:Class="DashBoard.View.DashBoardMain"
  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:DashBoard.View"
  7. xmlns:controls="clr-namespace:DashBoard.Controls"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <UserControl.Resources>
  11. <ResourceDictionary >
  12. <ResourceDictionary.MergedDictionaries>
  13. <ResourceDictionary Source="/UICommon;component/Resources.xaml"/>
  14. </ResourceDictionary.MergedDictionaries>
  15. <local:DeviceContert x:Key="DeviceConverter"/>
  16. </ResourceDictionary>
  17. </UserControl.Resources>
  18. <Grid>
  19. <ScrollViewer>
  20. <ItemsControl ItemsSource="{Binding DeviceData}">
  21. <ItemsControl.ItemTemplate>
  22. <DataTemplate>
  23. <Expander Header="{Binding Key}" IsExpanded="True">
  24. <ItemsControl ItemsSource="{Binding Value}">
  25. <ItemsControl.ItemTemplate>
  26. <DataTemplate>
  27. <controls:DeviceInfoPlot DeviceData="{Binding}"
  28. AlarmCommand="{Binding RelativeSource={RelativeSource AncestorType=local:DashBoardMain, Mode=FindAncestor}, Path=DataContext.WarningCommand}">
  29. <controls:DeviceInfoPlot.DeviceInfo>
  30. <MultiBinding Converter="{StaticResource DeviceConverter}">
  31. <Binding RelativeSource="{RelativeSource AncestorType=local:DashBoardMain, Mode=FindAncestor}" Path="DataContext.Devices"/>
  32. <Binding Path="DeviceId"/>
  33. </MultiBinding>
  34. </controls:DeviceInfoPlot.DeviceInfo>
  35. </controls:DeviceInfoPlot>
  36. </DataTemplate>
  37. </ItemsControl.ItemTemplate>
  38. <ItemsControl.ItemsPanel>
  39. <ItemsPanelTemplate>
  40. <WrapPanel/>
  41. </ItemsPanelTemplate>
  42. </ItemsControl.ItemsPanel>
  43. </ItemsControl>
  44. </Expander>
  45. </DataTemplate>
  46. </ItemsControl.ItemTemplate>
  47. </ItemsControl>
  48. </ScrollViewer>
  49. </Grid>
  50. </UserControl>