LightManual.xaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <UserControl x:Class="TeamAAS_VP.Views.DebugMod.LightManual"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.DebugMod"
  8. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  9. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  10. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  11. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  12. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  13. xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
  14. xmlns:localbehaviors="clr-namespace:TeamAAS_VP.Behaviors"
  15. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  16. lex:LocalizeDictionary.DesignCulture="zh-CN"
  17. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  18. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  19. prism:ViewModelLocator.AutoWireViewModel="True"
  20. mc:Ignorable="d"
  21. d:Width="1024"
  22. d:Height="768"
  23. d:Background="White"
  24. d:DataContext="{d:DesignInstance Type=vm:LightManualViewModel}"
  25. FontFamily="{DynamicResource DefaultFont}">
  26. <b:Interaction.Triggers>
  27. <b:EventTrigger EventName="Loaded">
  28. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  29. </b:EventTrigger>
  30. </b:Interaction.Triggers>
  31. <Grid VerticalAlignment="Top"
  32. IsEnabled="{Binding IsAllowEdit}">
  33. <ScrollViewer HorizontalScrollBarVisibility="Auto"
  34. VerticalScrollBarVisibility="Auto">
  35. <ItemsControl ItemsSource="{Binding Channels}">
  36. <ItemsControl.ItemTemplate>
  37. <DataTemplate>
  38. <Border BorderBrush="Gray"
  39. BorderThickness="1"
  40. Margin="6"
  41. Padding="8"
  42. CornerRadius="6">
  43. <StackPanel Orientation="Vertical">
  44. <StackPanel Orientation="Horizontal"
  45. VerticalAlignment="Center">
  46. <TextBlock Text="{lex:Loc 通道}"
  47. FontWeight="Bold"
  48. Margin="0,0,6,0" />
  49. <TextBlock Text="{Binding GlobalId}"
  50. Width="40" />
  51. <TextBlock Text="{lex:Loc 名称}"
  52. FontWeight="Bold"
  53. Margin="10,0,6,0" />
  54. <TextBlock Text="{Binding Name}" />
  55. </StackPanel>
  56. <StackPanel Orientation="Horizontal"
  57. VerticalAlignment="Center"
  58. Margin="0,8,0,0">
  59. <TextBlock Text="{lex:Loc 亮度}"
  60. VerticalAlignment="Center"
  61. Margin="0,0,6,0" />
  62. <Slider Width="280"
  63. Minimum="0"
  64. Maximum="255"
  65. Value="{Binding PendingBrightness,Mode=TwoWay}"
  66. SmallChange="1"
  67. LargeChange="10">
  68. <b:Interaction.Behaviors>
  69. <localbehaviors:SliderUserInteractionBehavior UserInteractionCommand="{Binding BrightnessChangedCommand}" />
  70. </b:Interaction.Behaviors>
  71. </Slider>
  72. <TextBlock Text="{Binding PendingBrightness}"
  73. Width="40"
  74. Margin="6,0,0,0"
  75. VerticalAlignment="Center" />
  76. </StackPanel>
  77. <StackPanel Orientation="Horizontal"
  78. HorizontalAlignment="Right"
  79. Margin="0,8,0,0">
  80. <Button Content="{lex:Loc 打开}"
  81. Command="{Binding TurnOnCommand}"
  82. Margin="0,0,8,0" />
  83. <Button Content="{lex:Loc 关闭}"
  84. Command="{Binding TurnOffCommand}"
  85. Margin="0,0,8,0" />
  86. <Button Content="{lex:Loc 保存}"
  87. Command="{Binding SaveCommand}" />
  88. </StackPanel>
  89. </StackPanel>
  90. </Border>
  91. </DataTemplate>
  92. </ItemsControl.ItemTemplate>
  93. <ItemsControl.ItemsPanel>
  94. <ItemsPanelTemplate>
  95. <StackPanel />
  96. </ItemsPanelTemplate>
  97. </ItemsControl.ItemsPanel>
  98. </ItemsControl>
  99. </ScrollViewer>
  100. </Grid>
  101. </UserControl>