EquipmentSettingWindow.xaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <UserControl
  2. x:Class="SHJX.Service.Shell.Views.Setting.EquipmentSettingWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:SettingLibrary="clr-namespace:SHJX.Service.Library.Views.SettingLibrary;assembly=SHJX.Service.Library"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:SHJX.Service.Shell.Views.Setting"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:prism="http://prismlibrary.com/"
  10. xmlns:pu="clr-namespace:Panuon.UI.Silver;assembly=Panuon.UI.Silver"
  11. Name="speedControl"
  12. d:DesignHeight="900"
  13. d:DesignWidth="800"
  14. prism:ViewModelLocator.AutoWireViewModel="True"
  15. mc:Ignorable="d">
  16. <UserControl.Resources>
  17. <!--#region Uniform样式-->
  18. <!-- 下面这段代码不用,不能变成Uniform的样式 -->
  19. <Style x:Key="ItemContainerStyle" TargetType="{x:Type ListViewItem}">
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate TargetType="{x:Type ListViewItem}">
  23. <Border
  24. x:Name="Bd"
  25. Background="{TemplateBinding Background}"
  26. BorderBrush="{TemplateBinding BorderBrush}"
  27. BorderThickness="0">
  28. <ContentPresenter />
  29. </Border>
  30. <ControlTemplate.Triggers>
  31. <Trigger Property="IsSelected" Value="true">
  32. <Setter TargetName="Bd" Property="Background" Value="Transparent" />
  33. </Trigger>
  34. </ControlTemplate.Triggers>
  35. </ControlTemplate>
  36. </Setter.Value>
  37. </Setter>
  38. </Style>
  39. <!--#endregion-->
  40. <DataTemplate x:Key="itemTemplate">
  41. <SettingLibrary:SpeedControl
  42. AcSpeed="{Binding AcSpeed}"
  43. Content="{Binding}"
  44. DeSpeed="{Binding DeSpeed}"
  45. HeaderValue="{Binding HeaderValue}"
  46. SettingSpeedCommand="{Binding ElementName=speedControl, Path=DataContext.SettingSpeedCommand}"
  47. Speed="{Binding Speed}"
  48. TagValue="{Binding TagValue}" />
  49. </DataTemplate>
  50. </UserControl.Resources>
  51. <Grid>
  52. <Grid.RowDefinitions>
  53. <RowDefinition Height="6*" />
  54. <RowDefinition Height="6*" />
  55. <RowDefinition Height="5*" />
  56. </Grid.RowDefinitions>
  57. <Grid
  58. Grid.Row="0"
  59. HorizontalAlignment="Center"
  60. VerticalAlignment="Center">
  61. <GroupBox
  62. Grid.Row="3"
  63. Width="700"
  64. Height="320"
  65. Margin="0,5,0,5"
  66. HorizontalAlignment="Center"
  67. VerticalAlignment="Center"
  68. pu:GroupBoxHelper.CornerRadius="8"
  69. pu:GroupBoxHelper.IsSplitLineVisible="True"
  70. pu:GroupBoxHelper.ShadowColor="LightGray"
  71. Header="速度设置(*1:主滴定位;2:加液位和副滴定位)">
  72. <Grid>
  73. <DataGrid
  74. Grid.Row="1"
  75. Width="680"
  76. Height="260"
  77. Margin="-5,0,0,0"
  78. pu:DataGridHelper.ColumnHorizontalContentAlignment="Center"
  79. pu:DataGridHelper.HeaderMinHeight="45"
  80. pu:DataGridHelper.HoverBackground="#22B5B5B5"
  81. pu:DataGridHelper.SelectedBackground="#44B5B5B5"
  82. CanUserAddRows="False"
  83. ItemsSource="{Binding MotorSpeeds}">
  84. <pu:DataGridHelper.AutoGenerateCheckBoxStyle>
  85. <Style BasedOn="{StaticResource {x:Type CheckBox}}" TargetType="CheckBox">
  86. <Setter Property="pu:CheckBoxHelper.CheckBoxStyle" Value="Switch" />
  87. <Style.Triggers>
  88. <DataTrigger Binding="{Binding Path=(pu:CheckBoxHelper.CheckBoxStyle), RelativeSource={RelativeSource Self}}" Value="Switch">
  89. <Setter Property="pu:CheckBoxHelper.CheckedBackground" Value="#6452A4" />
  90. </DataTrigger>
  91. </Style.Triggers>
  92. </Style>
  93. </pu:DataGridHelper.AutoGenerateCheckBoxStyle>
  94. </DataGrid>
  95. </Grid>
  96. </GroupBox>
  97. </Grid>
  98. <Grid Grid.Row="1">
  99. <SettingLibrary:GroupDataGridControl
  100. DataGridHeight="250"
  101. DataGridWidth="680"
  102. GroupBoxHeight="300"
  103. GroupBoxWidth="700"
  104. HeaderValue="加液设定(*1:主滴定位;2:加液位和副滴定位)"
  105. ItemSourceValue="{Binding LiquidVolumes}" />
  106. </Grid>
  107. <Grid Grid.Row="2">
  108. <SettingLibrary:GroupDataGridControl
  109. DataGridHeight="200"
  110. DataGridWidth="680"
  111. GroupBoxHeight="240"
  112. GroupBoxWidth="700"
  113. HeaderValue="液体总量"
  114. ItemSourceValue="{Binding LiquidTotals}" />
  115. </Grid>
  116. </Grid>
  117. </UserControl>