DissolveTopPos.xaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <UserControl
  2. x:Class="SHJX.Service.Main.Views.DissolveTopPos"
  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. d:DesignHeight="150"
  10. d:DesignWidth="800"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <DataTemplate x:Key="itemTemplate">
  15. <views:RingProcessBar
  16. CenterColor="{Binding CenterColor}"
  17. CurrentCycleValue="{Binding CurrentCycleValue}"
  18. CurrentText="{Binding CurrentText}"
  19. RoundVisiable="{Binding RoundVisiable}" />
  20. </DataTemplate>
  21. <!-- 下面这段代码不用,不能变成Uniform的样式 -->
  22. <Style x:Key="ItemContainerStyle" TargetType="{x:Type ListViewItem}">
  23. <Setter Property="Template">
  24. <Setter.Value>
  25. <ControlTemplate TargetType="{x:Type ListViewItem}">
  26. <Border
  27. x:Name="Bd"
  28. Background="{TemplateBinding Background}"
  29. BorderBrush="{TemplateBinding BorderBrush}"
  30. BorderThickness="0">
  31. <ContentPresenter />
  32. </Border>
  33. <ControlTemplate.Triggers>
  34. <Trigger Property="IsSelected" Value="true">
  35. <Setter TargetName="Bd" Property="Background" Value="Transparent" />
  36. </Trigger>
  37. </ControlTemplate.Triggers>
  38. </ControlTemplate>
  39. </Setter.Value>
  40. </Setter>
  41. </Style>
  42. </UserControl.Resources>
  43. <Grid>
  44. <ListView
  45. x:Name="DissolveAreas"
  46. Background="Transparent"
  47. ItemContainerStyle="{StaticResource ItemContainerStyle}"
  48. ItemTemplate="{StaticResource ResourceKey=itemTemplate}"
  49. ItemsSource="{Binding RingProcessBars}">
  50. <ListView.ItemsPanel>
  51. <ItemsPanelTemplate>
  52. <UniformGrid Columns="4" Rows="1" />
  53. </ItemsPanelTemplate>
  54. </ListView.ItemsPanel>
  55. </ListView>
  56. </Grid>
  57. </UserControl>