SampleRightPos.xaml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <UserControl
  2. x:Class="SHJX.Service.Main.Views.SampleRightPos"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:UI="clr-namespace:SHJX.Service.Library.Views;assembly=SHJX.Service.Library"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:local="clr-namespace:SHJX.Service.Main.Views"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:prism="http://prismlibrary.com/"
  11. xmlns:views="clr-namespace:SHJX.Service.Library.Views;assembly=SHJX.Service.Library"
  12. d:DesignHeight="400"
  13. d:DesignWidth="700"
  14. prism:ViewModelLocator.AutoWireViewModel="True"
  15. mc:Ignorable="d">
  16. <i:Interaction.Triggers>
  17. <i:EventTrigger EventName="Loaded">
  18. <i:InvokeCommandAction Command="{Binding LoadingCommand}" />
  19. </i:EventTrigger>
  20. </i:Interaction.Triggers>
  21. <UserControl.Resources>
  22. <DataTemplate x:Key="itemTemplate">
  23. <views:SampleDetailControl
  24. CurrentDetailInfo="{Binding SampleDetailInfo}"
  25. CurrentName="{Binding Name}"
  26. CurrentResult="{Binding SampleResult}"
  27. CurrentTagColor="{Binding SampleTagColor}"
  28. CurrentTagNo="{Binding TagCurrentTagNo}"
  29. CurrentVolume="{Binding SampleVolume}"
  30. ResultColor="{Binding SampleResultColor}" />
  31. </DataTemplate>
  32. <!-- 下面这段代码不用,不能变成Uniform的样式 -->
  33. <Style x:Key="ItemContainerStyle" TargetType="{x:Type ListViewItem}">
  34. <Setter Property="Template">
  35. <Setter.Value>
  36. <ControlTemplate TargetType="{x:Type ListViewItem}">
  37. <Border
  38. x:Name="Bd"
  39. Background="{TemplateBinding Background}"
  40. BorderBrush="{TemplateBinding BorderBrush}"
  41. BorderThickness="0">
  42. <ContentPresenter />
  43. </Border>
  44. <ControlTemplate.Triggers>
  45. <Trigger Property="IsSelected" Value="true">
  46. <Setter TargetName="Bd" Property="Background" Value="Transparent" />
  47. </Trigger>
  48. </ControlTemplate.Triggers>
  49. </ControlTemplate>
  50. </Setter.Value>
  51. </Setter>
  52. </Style>
  53. </UserControl.Resources>
  54. <Grid Margin="2,0,2,2">
  55. <ListView
  56. x:Name="LeftSample"
  57. Background="Transparent"
  58. ItemContainerStyle="{StaticResource ItemContainerStyle}"
  59. ItemTemplate="{StaticResource ResourceKey=itemTemplate}"
  60. ItemsSource="{Binding DetailControls}">
  61. <ListView.ItemsPanel>
  62. <ItemsPanelTemplate>
  63. <UniformGrid Columns="3" Rows="7" />
  64. </ItemsPanelTemplate>
  65. </ListView.ItemsPanel>
  66. </ListView>
  67. </Grid>
  68. </UserControl>