DissolveBottomPos.xaml 2.6 KB

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