ShakersView.xaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <UserControl
  2. x:Class="ShakerManger.View.ShakersView"
  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:ShakerManger.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:ShakerManger.ViewModel"
  9. d:DataContext="{d:DesignInstance {x:Type vm:ShakersViewModel}}"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data.MainPages[0]}"
  13. mc:Ignorable="d">
  14. <ListView Grid.Column="1" ItemsSource="{Binding LayoutShakers}">
  15. <ListView.Style>
  16. <Style TargetType="ListView" BasedOn="{x:Null}">
  17. <Setter Property="Background" Value="Transparent" />
  18. <Setter Property="BorderBrush" Value="Transparent" />
  19. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  20. <Setter Property="Padding" Value="0" />
  21. <Setter Property="Template">
  22. <Setter.Value>
  23. <ControlTemplate TargetType="ListView">
  24. <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  25. </ControlTemplate>
  26. </Setter.Value>
  27. </Setter>
  28. <Setter Property="ItemTemplate">
  29. <Setter.Value>
  30. <DataTemplate>
  31. <ContentControl Content="{Binding Content}" Visibility="{Binding IsVisible, Converter={StaticResource Boolean2VisibilityConverter}}" />
  32. </DataTemplate>
  33. </Setter.Value>
  34. </Setter>
  35. <Setter Property="ItemContainerStyle">
  36. <Setter.Value>
  37. <Style TargetType="ListViewItem">
  38. <Setter Property="Background" Value="Transparent" />
  39. <Setter Property="BorderBrush" Value="Transparent" />
  40. <Setter Property="BorderThickness" Value="0" />
  41. <Setter Property="SnapsToDevicePixels" Value="True" />
  42. <Setter Property="OverridesDefaultStyle" Value="True" />
  43. <Setter Property="IsEnabled" Value="True" />
  44. <Setter Property="Padding" Value="0" />
  45. <Setter Property="Template">
  46. <Setter.Value>
  47. <ControlTemplate TargetType="ListViewItem">
  48. <ContentPresenter
  49. Margin="4"
  50. Content="{TemplateBinding Content}"
  51. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  52. ContentTemplate="{TemplateBinding ContentTemplate}"
  53. ContentTemplateSelector="{x:Null}" />
  54. </ControlTemplate>
  55. </Setter.Value>
  56. </Setter>
  57. </Style>
  58. </Setter.Value>
  59. </Setter>
  60. <Setter Property="ItemsPanel">
  61. <Setter.Value>
  62. <ItemsPanelTemplate>
  63. <UniformGrid
  64. Margin="0"
  65. Columns="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}, Path=DataContext.Layout.ColumnCount}"
  66. Rows="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}, Path=DataContext.Layout.RowCount}"
  67. Style="{x:Null}" />
  68. </ItemsPanelTemplate>
  69. </Setter.Value>
  70. </Setter>
  71. </Style>
  72. </ListView.Style>
  73. </ListView>
  74. </UserControl>