OpLiquidPos.xaml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <UserControl
  2. x:Class="SHJX.Service.Main.Views.OpLiquidPos"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:prism="http://prismlibrary.com/"
  8. xmlns:views="clr-namespace:SHJX.Service.Library.Views;assembly=SHJX.Service.Library"
  9. prism:ViewModelLocator.AutoWireViewModel="True"
  10. mc:Ignorable="d" Width="450" Height="150">
  11. <UserControl.Resources>
  12. <!-- 下面这段代码不用,不能变成Uniform的样式 -->
  13. <Style x:Key="ItemContainerStyle"
  14. TargetType="{x:Type ListViewItem}">
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="{x:Type ListViewItem}">
  18. <Border x:Name="Bd"
  19. Background="{TemplateBinding Background}"
  20. BorderBrush="{TemplateBinding BorderBrush}"
  21. BorderThickness="0">
  22. <ContentPresenter />
  23. </Border>
  24. <ControlTemplate.Triggers>
  25. <Trigger Property="IsSelected"
  26. Value="true">
  27. <Setter TargetName="Bd"
  28. Property="Background"
  29. Value="Transparent" />
  30. </Trigger>
  31. </ControlTemplate.Triggers>
  32. </ControlTemplate>
  33. </Setter.Value>
  34. </Setter>
  35. </Style>
  36. <DataTemplate x:Key="itemTemplate">
  37. <views:CenterControl BackColor="{Binding BackColor}"
  38. CenterText="{Binding CenterText}"
  39. TagNameText="{Binding TagNameText}" />
  40. </DataTemplate>
  41. </UserControl.Resources>
  42. <Grid>
  43. <ListView x:Name="LeftSample"
  44. Background="Transparent"
  45. ItemContainerStyle="{StaticResource ItemContainerStyle}"
  46. ItemTemplate="{StaticResource ResourceKey=itemTemplate}"
  47. ItemsSource="{Binding CenterControls}">
  48. <ListView.ItemsPanel>
  49. <ItemsPanelTemplate>
  50. <UniformGrid Columns="3" Rows="1" />
  51. </ItemsPanelTemplate>
  52. </ListView.ItemsPanel>
  53. </ListView>
  54. </Grid>
  55. </UserControl>