|
16 | 16 | <vc:ImageModelToImageConverter x:Key="ImageModelToImageConverter" />
|
17 | 17 | </UserControl.Resources>
|
18 | 18 |
|
19 |
| - <Grid> |
20 |
| - <!-- Collection of containers --> |
21 |
| - <GridView |
22 |
| - IsItemClickEnabled="False" |
23 |
| - ItemsSource="{x:Bind ViewModel.Containers}" |
24 |
| - SelectionMode="None"> |
25 |
| - |
26 |
| - <!-- Remove Reveal Highlight Effect --> |
27 |
| - <GridView.ItemContainerStyle> |
28 |
| - <Style TargetType="GridViewItem"> |
29 |
| - <!-- Spacing --> |
30 |
| - <Setter Property="Margin" Value="0,0,6,6" /> |
31 |
| - <Setter Property="Template"> |
32 |
| - <Setter.Value> |
33 |
| - <ControlTemplate TargetType="GridViewItem"> |
34 |
| - <ListViewItemPresenter |
35 |
| - x:Name="Root" |
36 |
| - RevealBackground="{ThemeResource GridViewItemRevealBackground}" |
37 |
| - RevealBorderBrush="{ThemeResource GridViewItemRevealBorderBrush}" |
38 |
| - RevealBorderThickness="0" /> |
39 |
| - </ControlTemplate> |
40 |
| - </Setter.Value> |
41 |
| - </Setter> |
42 |
| - </Style> |
43 |
| - </GridView.ItemContainerStyle> |
44 |
| - |
45 |
| - <!-- Container template --> |
46 |
| - <GridView.ItemTemplate> |
47 |
| - <DataTemplate x:DataType="vm:FileTagsContainerViewModel"> |
48 |
| - <Grid |
49 |
| - Width="216" |
50 |
| - Height="286" |
51 |
| - Padding="16,12" |
52 |
| - AllowDrop="True" |
53 |
| - Background="{ThemeResource ControlFillColorDefaultBrush}" |
54 |
| - CornerRadius="{StaticResource ControlCornerRadius}" |
55 |
| - RowSpacing="12"> |
56 |
| - <Grid.RowDefinitions> |
57 |
| - <!-- Title --> |
58 |
| - <RowDefinition Height="Auto" /> |
59 |
| - <!-- Contents --> |
60 |
| - <RowDefinition /> |
61 |
| - <!-- View More --> |
62 |
| - <RowDefinition Height="Auto" /> |
63 |
| - </Grid.RowDefinitions> |
| 19 | + <!-- Collection of containers --> |
| 20 | + <ItemsRepeater ItemsSource="{x:Bind ViewModel.Containers}"> |
| 21 | + <ItemsRepeater.Layout> |
| 22 | + <UniformGridLayout |
| 23 | + ItemsStretch="Fill" |
| 24 | + MaximumRowsOrColumns="6" |
| 25 | + MinColumnSpacing="8" |
| 26 | + MinItemHeight="286" |
| 27 | + MinItemWidth="240" |
| 28 | + MinRowSpacing="8" |
| 29 | + Orientation="Horizontal" /> |
| 30 | + </ItemsRepeater.Layout> |
64 | 31 |
|
| 32 | + <!-- Container template --> |
| 33 | + <ItemsRepeater.ItemTemplate> |
| 34 | + <DataTemplate x:DataType="vm:FileTagsContainerViewModel"> |
| 35 | + <Grid |
| 36 | + HorizontalAlignment="Stretch" |
| 37 | + VerticalAlignment="Stretch" |
| 38 | + AllowDrop="True" |
| 39 | + Background="{ThemeResource ControlFillColorDefaultBrush}" |
| 40 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 41 | + BorderThickness="1" |
| 42 | + CornerRadius="{StaticResource ControlCornerRadius}"> |
| 43 | + <Grid.RowDefinitions> |
65 | 44 | <!-- Title -->
|
66 |
| - <StackPanel |
67 |
| - Grid.Row="0" |
68 |
| - Orientation="Horizontal" |
69 |
| - Spacing="8"> |
70 |
| - <Ellipse |
71 |
| - Width="10" |
72 |
| - Height="10" |
73 |
| - Fill="{x:Bind Color, Mode=OneWay, Converter={StaticResource StringToBrushConverter}}" /> |
74 |
| - <TextBlock |
75 |
| - Margin="0,-2,0,0" |
76 |
| - FontWeight="SemiBold" |
77 |
| - Text="{x:Bind Name, Mode=OneWay}" /> |
78 |
| - </StackPanel> |
79 |
| - |
| 45 | + <RowDefinition Height="Auto" /> |
80 | 46 | <!-- Contents -->
|
81 |
| - <GridView |
82 |
| - Grid.Row="1" |
83 |
| - HorizontalAlignment="Center" |
84 |
| - IsItemClickEnabled="True" |
85 |
| - ItemClick="FileTagItem_ItemClick" |
86 |
| - ItemsSource="{x:Bind Tags}" |
87 |
| - SelectionMode="None"> |
88 |
| - <GridView.ItemTemplate> |
89 |
| - <DataTemplate x:DataType="vm:FileTagsItemViewModel"> |
90 |
| - <Grid Padding="8,0" ColumnSpacing="6"> |
91 |
| - <Grid.ColumnDefinitions> |
92 |
| - <!-- Icon --> |
93 |
| - <ColumnDefinition Width="Auto" /> |
94 |
| - <!-- Name --> |
95 |
| - <ColumnDefinition /> |
96 |
| - </Grid.ColumnDefinitions> |
| 47 | + <RowDefinition Height="*" /> |
| 48 | + <!-- View More --> |
| 49 | + <RowDefinition Height="Auto" /> |
| 50 | + </Grid.RowDefinitions> |
97 | 51 |
|
98 |
| - <!-- Icon --> |
99 |
| - <Image |
100 |
| - Grid.Column="0" |
101 |
| - Width="20" |
102 |
| - Height="20" |
103 |
| - HorizontalAlignment="Left" |
104 |
| - VerticalAlignment="Center" |
105 |
| - Source="{x:Bind Icon, Mode=OneWay, Converter={StaticResource ImageModelToImageConverter}}" /> |
| 52 | + <!-- Title --> |
| 53 | + <StackPanel |
| 54 | + Grid.Row="0" |
| 55 | + Padding="12,8" |
| 56 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 57 | + BorderThickness="0,0,0,1" |
| 58 | + Orientation="Horizontal" |
| 59 | + Spacing="8"> |
| 60 | + <Ellipse |
| 61 | + Width="12" |
| 62 | + Height="12" |
| 63 | + Fill="{x:Bind Color, Mode=OneWay, Converter={StaticResource StringToBrushConverter}}" /> |
| 64 | + <TextBlock |
| 65 | + Margin="0,-2,0,0" |
| 66 | + FontWeight="SemiBold" |
| 67 | + Text="{x:Bind Name, Mode=OneWay}" /> |
| 68 | + </StackPanel> |
106 | 69 |
|
107 |
| - <!-- Name --> |
108 |
| - <TextBlock |
109 |
| - Grid.Column="1" |
110 |
| - Margin="0,-3,0,0" |
111 |
| - Text="{x:Bind Name, Mode=OneWay}" /> |
112 |
| - </Grid> |
113 |
| - </DataTemplate> |
114 |
| - </GridView.ItemTemplate> |
115 |
| - </GridView> |
| 70 | + <!-- Contents --> |
| 71 | + <GridView |
| 72 | + Grid.Row="1" |
| 73 | + Padding="4" |
| 74 | + HorizontalAlignment="Stretch" |
| 75 | + IsItemClickEnabled="True" |
| 76 | + ItemClick="FileTagItem_ItemClick" |
| 77 | + ItemsSource="{x:Bind Tags}" |
| 78 | + SelectionMode="None"> |
| 79 | + <GridView.ItemContainerStyle> |
| 80 | + <Style BasedOn="{StaticResource DefaultGridViewItemStyle}" TargetType="GridViewItem"> |
| 81 | + <!-- Spacing --> |
| 82 | + <Setter Property="Padding" Value="8,0" /> |
| 83 | + <Setter Property="MinHeight" Value="{ThemeResource ListItemHeight}" /> |
| 84 | + </Style> |
| 85 | + </GridView.ItemContainerStyle> |
116 | 86 |
|
117 |
| - <!-- View More --> |
118 |
| - <HyperlinkButton |
119 |
| - Grid.Row="2" |
120 |
| - HorizontalAlignment="Center" |
121 |
| - Content="View more" /> |
122 |
| - </Grid> |
123 |
| - </DataTemplate> |
124 |
| - </GridView.ItemTemplate> |
125 |
| - </GridView> |
126 |
| - </Grid> |
| 87 | + <GridView.ItemTemplate> |
| 88 | + <DataTemplate x:DataType="vm:FileTagsItemViewModel"> |
| 89 | + <StackPanel Orientation="Horizontal" Spacing="8"> |
| 90 | + <!-- Icon --> |
| 91 | + <Image |
| 92 | + Width="20" |
| 93 | + Height="20" |
| 94 | + Source="{x:Bind Icon, Mode=OneWay, Converter={StaticResource ImageModelToImageConverter}}" /> |
| 95 | + |
| 96 | + <!-- Name --> |
| 97 | + <TextBlock Text="{x:Bind Name, Mode=OneWay}" /> |
| 98 | + </StackPanel> |
| 99 | + </DataTemplate> |
| 100 | + </GridView.ItemTemplate> |
| 101 | + </GridView> |
| 102 | + |
| 103 | + <!-- View More --> |
| 104 | + <HyperlinkButton |
| 105 | + Grid.Row="2" |
| 106 | + HorizontalAlignment="Center" |
| 107 | + Content="View more" /> |
| 108 | + </Grid> |
| 109 | + </DataTemplate> |
| 110 | + </ItemsRepeater.ItemTemplate> |
| 111 | + </ItemsRepeater> |
127 | 112 | </UserControl>
|
0 commit comments