| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <UserControl
- x:Class="SHJX.Service.Main.Views.OpLiquidPos"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- 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"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d" Width="450" Height="150">
- <UserControl.Resources>
- <!-- 下面这段代码不用,不能变成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>
- <DataTemplate x:Key="itemTemplate">
- <views:CenterControl BackColor="{Binding BackColor}"
- CenterText="{Binding CenterText}"
- TagNameText="{Binding TagNameText}" />
- </DataTemplate>
- </UserControl.Resources>
- <Grid>
- <ListView x:Name="LeftSample"
- Background="Transparent"
- ItemContainerStyle="{StaticResource ItemContainerStyle}"
- ItemTemplate="{StaticResource ResourceKey=itemTemplate}"
- ItemsSource="{Binding CenterControls}">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="3" Rows="1" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- </ListView>
- </Grid>
- </UserControl>
|