| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <UserControl
- x:Class="SHJX.Service.Main.Views.SampleRightPos"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:UI="clr-namespace:SHJX.Service.Library.Views;assembly=SHJX.Service.Library"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:SHJX.Service.Main.Views"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:views="clr-namespace:SHJX.Service.Library.Views;assembly=SHJX.Service.Library"
- d:DesignHeight="400"
- d:DesignWidth="700"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Loaded">
- <i:InvokeCommandAction Command="{Binding LoadingCommand}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <UserControl.Resources>
- <DataTemplate x:Key="itemTemplate">
- <views:SampleDetailControl
- CurrentDetailInfo="{Binding SampleDetailInfo}"
- CurrentName="{Binding Name}"
- CurrentResult="{Binding SampleResult}"
- CurrentTagColor="{Binding SampleTagColor}"
- CurrentTagNo="{Binding TagCurrentTagNo}"
- CurrentVolume="{Binding SampleVolume}"
- ResultColor="{Binding SampleResultColor}" />
- </DataTemplate>
- <!-- 下面这段代码不用,不能变成Uniform的样式 -->
- <Style x:Key="ItemContainerStyle" TargetType="{x:Type ListViewItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListViewItem}">
- <Border
- x:Name="Bd"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="0">
- <ContentPresenter />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="true">
- <Setter TargetName="Bd" Property="Background" Value="Transparent" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid Margin="2,0,2,2">
- <ListView
- x:Name="LeftSample"
- Background="Transparent"
- ItemContainerStyle="{StaticResource ItemContainerStyle}"
- ItemTemplate="{StaticResource ResourceKey=itemTemplate}"
- ItemsSource="{Binding DetailControls}">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="3" Rows="7" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- </ListView>
- </Grid>
- </UserControl>
|