OilMinView.axaml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <UserControl
  2. x:Class="ShakerApp.Views.OilMinView"
  3. xmlns="https://github.com/avaloniaui"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="using:ShakerApp"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:suki="https://github.com/kikipoulet/SukiUI"
  9. xmlns:vm="using:ShakerApp.ViewModels"
  10. d:DesignHeight="450"
  11. d:DesignWidth="150"
  12. x:DataType="vm:OilSourceStatusViewModel"
  13. DataContext="{Binding Source={x:Static vm:OilSourceStatusViewModel.Instance}}"
  14. mc:Ignorable="d">
  15. <Expander ExpandDirection="Down">
  16. <Expander.Header>
  17. <TextBlock
  18. FontSize="24"
  19. FontWeight="Bold"
  20. Text="{DynamicResource OilStatus}" />
  21. </Expander.Header>
  22. <ItemsControl ItemsSource="{Binding OilSourceAnalogs}">
  23. <ItemsControl.ItemTemplate>
  24. <DataTemplate>
  25. <StackPanel>
  26. <TextBlock
  27. HorizontalAlignment="Center"
  28. VerticalAlignment="Center"
  29. FontSize="24"
  30. Foreground="{StaticResource OilDefaultColor}"
  31. Text="{local:ResourceBinding Name}" />
  32. <TextBlock
  33. HorizontalAlignment="Center"
  34. VerticalAlignment="Center"
  35. Classes.IsError="{Binding IsError}"
  36. Classes.IsWarn="{Binding IsWarn}"
  37. FontSize="26"
  38. FontWeight="Bold">
  39. <Run Text="{Binding Value, StringFormat='{}{0:0.00}'}" />
  40. <Run Text="{Binding Unit}" />
  41. <TextBlock.Styles>
  42. <Style Selector="TextBlock">
  43. <Setter Property="Foreground" Value="{StaticResource OilDefaultColor}" />
  44. </Style>
  45. <Style Selector="TextBlock.IsError">
  46. <Setter Property="Foreground" Value="{StaticResource ErrorColor}" />
  47. </Style>
  48. <Style Selector="TextBlock.IsWarn">
  49. <Setter Property="Foreground" Value="{StaticResource WarnColor}" />
  50. </Style>
  51. </TextBlock.Styles>
  52. </TextBlock>
  53. </StackPanel>
  54. </DataTemplate>
  55. </ItemsControl.ItemTemplate>
  56. </ItemsControl>
  57. </Expander>
  58. </UserControl>