|
3 | 3 | x:Class="Files.App.UserControls.ShelfPane" |
4 | 4 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
5 | 5 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
6 | | - xmlns:controls="using:Files.App.Controls" |
7 | 6 | xmlns:converters="using:Files.App.Converters" |
8 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
9 | 8 | xmlns:data="using:Files.App.Data.Items" |
10 | 9 | xmlns:helpers="using:Files.App.Helpers" |
11 | 10 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
12 | | - xmlns:usercontrols="using:Files.App.UserControls" |
13 | 11 | mc:Ignorable="d"> |
14 | 12 |
|
| 13 | + <UserControl.Resources> |
| 14 | + <converters:ImageModelToImageConverter x:Key="ImageModelToImageConverter" /> |
| 15 | + </UserControl.Resources> |
| 16 | + |
15 | 17 | <Grid |
16 | 18 | Width="240" |
| 19 | + Padding="12" |
| 20 | + AllowDrop="True" |
17 | 21 | Background="{ThemeResource App.Theme.InfoPane.BackgroundBrush}" |
18 | 22 | BackgroundSizing="InnerBorderEdge" |
19 | 23 | BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
20 | 24 | BorderThickness="1" |
21 | | - CornerRadius="8" /> |
| 25 | + CornerRadius="8" |
| 26 | + DragOver="Shelf_DragOver" |
| 27 | + Drop="Shelf_Drop" |
| 28 | + RowSpacing="8"> |
| 29 | + |
| 30 | + <Grid.RowDefinitions> |
| 31 | + <RowDefinition Height="Auto" /> |
| 32 | + <RowDefinition Height="*" /> |
| 33 | + <RowDefinition Height="Auto" /> |
| 34 | + </Grid.RowDefinitions> |
| 35 | + |
| 36 | + <StackPanel Grid.Row="0" Spacing="8"> |
| 37 | + |
| 38 | + <!-- Title --> |
| 39 | + <TextBlock |
| 40 | + HorizontalAlignment="Center" |
| 41 | + Foreground="{ThemeResource TextFillColorTertiaryBrush}" |
| 42 | + Style="{StaticResource App.Theme.BodyTextBlockStyle}" |
| 43 | + Text="{helpers:ResourceString Name=Shelf}" /> |
| 44 | + |
| 45 | + <!-- (Divider) --> |
| 46 | + <Border Height="1" Background="{ThemeResource DividerStrokeColorDefaultBrush}" /> |
| 47 | + |
| 48 | + </StackPanel> |
| 49 | + |
| 50 | + <!-- Items List --> |
| 51 | + <ListView |
| 52 | + Grid.Row="1" |
| 53 | + DragItemsStarting="ListView_DragItemsStarting" |
| 54 | + ItemsSource="{x:Bind ItemsSource, Mode=OneWay}" |
| 55 | + ScrollViewer.VerticalScrollBarVisibility="Auto" |
| 56 | + ScrollViewer.VerticalScrollMode="Auto" |
| 57 | + SelectionMode="Extended"> |
| 58 | + <ListView.ItemTemplate> |
| 59 | + <DataTemplate x:DataType="data:ShelfItem"> |
| 60 | + <StackPanel Orientation="Horizontal" Spacing="8"> |
| 61 | + <Image |
| 62 | + Width="16" |
| 63 | + Height="16" |
| 64 | + Source="{x:Bind Icon, Mode=OneWay, Converter={StaticResource ImageModelToImageConverter}}" /> |
| 65 | + <TextBlock Text="{x:Bind Name, Mode=OneWay}" /> |
| 66 | + |
| 67 | + <StackPanel.ContextFlyout> |
| 68 | + <MenuFlyout> |
| 69 | + <MenuFlyoutItem Command="{x:Bind RemoveCommand}" Text="{helpers:ResourceString Name=RemoveFromShelf}"> |
| 70 | + <MenuFlyoutItem.Icon> |
| 71 | + <FontIcon Glyph="" /> |
| 72 | + </MenuFlyoutItem.Icon> |
| 73 | + </MenuFlyoutItem> |
| 74 | + </MenuFlyout> |
| 75 | + </StackPanel.ContextFlyout> |
| 76 | + </StackPanel> |
| 77 | + </DataTemplate> |
| 78 | + </ListView.ItemTemplate> |
| 79 | + |
| 80 | + <ListView.ItemContainerStyle> |
| 81 | + <Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem"> |
| 82 | + <Setter Property="Margin" Value="-4,0,-4,0" /> |
| 83 | + <Setter Property="MinHeight" Value="36" /> |
| 84 | + </Style> |
| 85 | + </ListView.ItemContainerStyle> |
| 86 | + </ListView> |
| 87 | + |
| 88 | + |
| 89 | + <StackPanel Grid.Row="2" Spacing="4"> |
| 90 | + |
| 91 | + <!-- (Divider) --> |
| 92 | + <Border Height="1" Background="{ThemeResource DividerStrokeColorDefaultBrush}" /> |
| 93 | + |
| 94 | + <!-- Bottom Actions --> |
| 95 | + <HyperlinkButton |
| 96 | + HorizontalAlignment="Center" |
| 97 | + VerticalAlignment="Center" |
| 98 | + Command="{x:Bind ClearCommand, Mode=OneWay}" |
| 99 | + Content="{helpers:ResourceString Name=ClearItems}" /> |
| 100 | + |
| 101 | + </StackPanel> |
| 102 | + </Grid> |
22 | 103 | </UserControl> |
0 commit comments