|
8 | 8 | xmlns:list="using:Locations" |
9 | 9 | xmlns:local="using:Files" |
10 | 10 | xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)" |
11 | | - mc:Ignorable="d"> |
| 11 | + mc:Ignorable="d" NavigationCacheMode="Required"> |
12 | 12 | <Page.Resources> |
13 | 13 | <Style x:Key="MenuFlyoutFluentThemeResources" TargetType="MenuFlyoutPresenter"> |
14 | 14 | <Setter Property="CornerRadius" Value="4" /> |
|
499 | 499 | </Setter.Value> |
500 | 500 | </Setter> |
501 | 501 | </Style> |
| 502 | + <Style x:Key="ListViewItemContainerStyle1" TargetType="ListViewItem"> |
| 503 | + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> |
| 504 | + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> |
| 505 | + <Setter Property="Background" Value="{ThemeResource ListViewItemBackground}"/> |
| 506 | + <Setter Property="Foreground" Value="{ThemeResource ListViewItemForeground}"/> |
| 507 | + <Setter Property="TabNavigation" Value="Local"/> |
| 508 | + <Setter Property="IsHoldingEnabled" Value="True"/> |
| 509 | + <Setter Property="Padding" Value="12,0,12,0"/> |
| 510 | + <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
| 511 | + <Setter Property="VerticalContentAlignment" Value="Stretch"/> |
| 512 | + <Setter Property="MinWidth" Value="{ThemeResource ListViewItemMinWidth}"/> |
| 513 | + <Setter Property="MinHeight" Value="{ThemeResource ListViewItemMinHeight}"/> |
| 514 | + <Setter Property="AllowDrop" Value="False"/> |
| 515 | + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}"/> |
| 516 | + <Setter Property="FocusVisualMargin" Value="0"/> |
| 517 | + <Setter Property="Template"> |
| 518 | + <Setter.Value> |
| 519 | + <ControlTemplate TargetType="ListViewItem"> |
| 520 | + <ListViewItemPresenter x:Name="Root" CheckBrush="{ThemeResource ListViewItemCheckBrush}" ContentMargin="{TemplateBinding Padding}" CheckBoxBrush="{ThemeResource ListViewItemCheckBoxBrush}" ContentTransitions="{TemplateBinding ContentTransitions}" CheckMode="{ThemeResource ListViewItemCheckMode}" DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}" DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}" DragBackground="{ThemeResource ListViewItemDragBackground}" DragForeground="{ThemeResource ListViewItemDragForeground}" FocusBorderBrush="{ThemeResource ListViewItemFocusBorderBrush}" FocusVisualMargin="{TemplateBinding FocusVisualMargin}" FocusSecondaryBorderBrush="{ThemeResource ListViewItemFocusSecondaryBorderBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Control.IsTemplateFocusTarget="True" PressedBackground="{ThemeResource ListViewItemBackgroundPressed}" PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackground}" PointerOverForeground="{ThemeResource ListViewItemForegroundPointerOver}" PointerOverBackground="{ThemeResource ListViewItemBackgroundPointerOver}" RevealBorderThickness="{ThemeResource ListViewItemRevealBorderThemeThickness}" ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" RevealBorderBrush="{ThemeResource ListViewItemRevealBorderBrush}" RevealBackground="{ThemeResource ListViewItemRevealBackground}" SelectedForeground="{ThemeResource ListViewItemForegroundSelected}" SelectionCheckMarkVisualEnabled="{ThemeResource ListViewItemSelectionCheckMarkVisualEnabled}" SelectedBackground="{ThemeResource ListViewItemBackgroundSelected}" SelectedPressedBackground="{ThemeResource ListViewItemBackgroundSelectedPressed}" SelectedPointerOverBackground="{ThemeResource ListViewItemBackgroundSelectedPointerOver}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"> |
| 521 | + <VisualStateManager.VisualStateGroups> |
| 522 | + <VisualStateGroup x:Name="CommonStates"> |
| 523 | + <VisualState x:Name="Normal"/> |
| 524 | + <VisualState x:Name="Selected"/> |
| 525 | + <VisualState x:Name="PointerOver"> |
| 526 | + <VisualState.Setters> |
| 527 | + <Setter Target="Root.(RevealBrush.State)" Value="PointerOver"/> |
| 528 | + <Setter Target="Root.RevealBorderBrush" Value="{ThemeResource ListViewItemRevealBorderBrushPointerOver}"/> |
| 529 | + </VisualState.Setters> |
| 530 | + </VisualState> |
| 531 | + <VisualState x:Name="PointerOverSelected"> |
| 532 | + <VisualState.Setters> |
| 533 | + <Setter Target="Root.(RevealBrush.State)" Value="PointerOver"/> |
| 534 | + <Setter Target="Root.RevealBorderBrush" Value="{ThemeResource ListViewItemRevealBorderBrushPointerOver}"/> |
| 535 | + </VisualState.Setters> |
| 536 | + </VisualState> |
| 537 | + <VisualState x:Name="PointerOverPressed"> |
| 538 | + <VisualState.Setters> |
| 539 | + <Setter Target="Root.(RevealBrush.State)" Value="Pressed"/> |
| 540 | + <Setter Target="Root.RevealBorderBrush" Value="{ThemeResource ListViewItemRevealBorderBrushPressed}"/> |
| 541 | + </VisualState.Setters> |
| 542 | + </VisualState> |
| 543 | + <VisualState x:Name="Pressed"> |
| 544 | + <VisualState.Setters> |
| 545 | + <Setter Target="Root.(RevealBrush.State)" Value="Pressed"/> |
| 546 | + <Setter Target="Root.RevealBorderBrush" Value="{ThemeResource ListViewItemRevealBorderBrushPressed}"/> |
| 547 | + </VisualState.Setters> |
| 548 | + </VisualState> |
| 549 | + <VisualState x:Name="PressedSelected"> |
| 550 | + <VisualState.Setters> |
| 551 | + <Setter Target="Root.(RevealBrush.State)" Value="Pressed"/> |
| 552 | + <Setter Target="Root.RevealBorderBrush" Value="{ThemeResource ListViewItemRevealBorderBrushPressed}"/> |
| 553 | + </VisualState.Setters> |
| 554 | + </VisualState> |
| 555 | + </VisualStateGroup> |
| 556 | + <VisualStateGroup x:Name="DisabledStates"> |
| 557 | + <VisualState x:Name="Enabled"/> |
| 558 | + <VisualState x:Name="Disabled"> |
| 559 | + <VisualState.Setters> |
| 560 | + <Setter Target="Root.RevealBorderThickness" Value="0"/> |
| 561 | + </VisualState.Setters> |
| 562 | + </VisualState> |
| 563 | + </VisualStateGroup> |
| 564 | + </VisualStateManager.VisualStateGroups> |
| 565 | + </ListViewItemPresenter> |
| 566 | + </ControlTemplate> |
| 567 | + </Setter.Value> |
| 568 | + </Setter> |
| 569 | + </Style> |
502 | 570 |
|
503 | 571 | </Page.Resources> |
504 | 572 | <ScrollViewer> |
505 | 573 | <Grid Padding="24,10,24,0" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
506 | 574 | <StackPanel Spacing="10" Orientation="Vertical"> |
507 | | - <TextBlock x:Name="FavoritesCardsHeader" x:Load="{x:Bind favoritesCardsVis}" Padding="0,0,0,0" FontFamily="Segoe UI" FontSize="20" Text="Favorites" VerticalAlignment="Bottom" Grid.ColumnSpan="2" HorizontalAlignment="Left" /> |
508 | | - <controls:AdaptiveGridView x:Load="{x:Bind favoritesCardsVis}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" IsItemClickEnabled="True" Name="CardsList" ItemContainerStyle="{StaticResource AdaptiveGridViewItemContainerStyle2}" ItemsSource="{x:Bind list:ItemLoader.itemsAdded}" Padding="0,0,0,0" OneRowModeEnabled="False" ItemHeight="100" DesiredWidth="175" Grid.Row="1" Grid.ColumnSpan="2" ItemClick="CardPressed"> |
| 575 | + <TextBlock x:Name="FavoritesCardsHeader" Padding="0,0,0,0" FontFamily="Segoe UI" FontSize="20" Text="Favorites" VerticalAlignment="Bottom" Grid.ColumnSpan="2" HorizontalAlignment="Left" /> |
| 576 | + <controls:AdaptiveGridView ScrollViewer.HorizontalScrollBarVisibility="Hidden" IsItemClickEnabled="True" Name="CardsList" ItemContainerStyle="{StaticResource AdaptiveGridViewItemContainerStyle2}" ItemsSource="{x:Bind list:ItemLoader.itemsAdded}" Padding="0,0,0,0" OneRowModeEnabled="False" ItemHeight="100" DesiredWidth="175" Grid.Row="1" Grid.ColumnSpan="2" ItemClick="CardPressed"> |
509 | 577 | <controls:AdaptiveGridView.ItemTemplate> |
510 | 578 | <DataTemplate> |
511 | 579 | <Grid Margin="0,0,0,0" Padding="0,0,0,0"> |
|
525 | 593 | </DataTemplate> |
526 | 594 | </controls:AdaptiveGridView.ItemTemplate> |
527 | 595 | </controls:AdaptiveGridView> |
528 | | - <SplitView PaneBackground="Transparent" DisplayMode="Inline" PanePlacement="Right" IsPaneOpen="{x:Bind drivesListVis}"> |
529 | | - <SplitView.Content> |
530 | | - <Grid x:Name="RecentsListGrid" x:Load="{x:Bind recentsListVis}" Grid.Column="0"> |
531 | | - <StackPanel Orientation="Vertical"> |
532 | | - <TextBlock Margin="0,0,0,0" FontFamily="Segoe UI" FontSize="20" Text="Recent Items" HorizontalAlignment="Left"/> |
533 | | - <TextBlock Visibility="{x:Bind local:YourHome.Empty.Visibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="0,24,0,0" Text="Files and folders you've previously accessed will show up here" HorizontalAlignment="Stretch" TextAlignment="Center" TextWrapping="WrapWholeWords" FontSize="14"/> |
534 | | - <ListView IsItemClickEnabled="True" IsRightTapEnabled="True" RightTapped="RecentsView_RightTapped" ItemClick="RecentsView_ItemClick" ItemsSource="{x:Bind local:YourHome.recentItemsCollection}" Name="RecentsView" HorizontalAlignment="Stretch" Padding="0,0,0,0" VerticalAlignment="Stretch" Margin="0,0,0,0"> |
535 | | - <ListView.ItemTemplate> |
536 | | - <DataTemplate> |
537 | | - <Grid ToolTipService.ToolTip="{Binding path}" Padding="2.5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
538 | | - <Grid.ContextFlyout> |
539 | | - <MenuFlyout MenuFlyoutPresenterStyle="{StaticResource MenuFlyoutFluentThemeResources}"> |
540 | | - <MenuFlyoutItem Click="mfi_RemoveOneItem_Click" Icon="Remove" Text="Remove this item" x:Name="mfi_RemoveOneItem"/> |
541 | | - <MenuFlyoutItem Click="MenuFlyoutItem_Click" Icon="Delete" Text="Clear all items"/> |
542 | | - </MenuFlyout> |
543 | | - </Grid.ContextFlyout> |
544 | | - <StackPanel VerticalAlignment="Center" Orientation="Horizontal" Spacing="10"> |
545 | | - <Grid VerticalAlignment="Stretch" Margin="0, 0, 0, 0"> |
546 | | - <FontIcon Visibility="{Binding FolderImg}" FontSize="24" Glyph="" FontFamily="Segoe MDL2 Assets" Foreground="#ffe793"/> |
547 | | - <FontIcon Visibility="{Binding EmptyImgVis}" FontSize="24" Glyph="" FontFamily="Segoe MDL2 Assets"/> |
548 | | - <Image Visibility="{Binding FileIconVis}" Height="24" Width="24" Source="{Binding FileImg}" Stretch="UniformToFill" /> |
549 | | - </Grid> |
550 | | - <Grid RowSpacing="2"> |
551 | | - <Grid.RowDefinitions> |
552 | | - <RowDefinition/> |
553 | | - <RowDefinition/> |
554 | | - </Grid.RowDefinitions> |
555 | | - <TextBlock Grid.Row="0" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Text="{Binding name}" VerticalAlignment="Center"/> |
556 | | - <TextBlock Foreground="DimGray" FontSize="10" Grid.Row="1" Margin="0,0,0,0" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Text="{Binding path}" VerticalAlignment="Center"/> |
557 | | - </Grid> |
558 | | - </StackPanel> |
559 | | - </Grid> |
560 | | - </DataTemplate> |
561 | | - </ListView.ItemTemplate> |
562 | | - <ListView.ItemContainerStyle> |
563 | | - <Style TargetType="ListViewItem"> |
564 | | - <Style.Setters> |
565 | | - <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
566 | | - <Setter Property="VerticalContentAlignment" Value="Stretch"/> |
567 | | - </Style.Setters> |
568 | | - </Style> |
569 | | - </ListView.ItemContainerStyle> |
570 | | - </ListView> |
571 | | - </StackPanel> |
572 | | - </Grid> |
573 | | - </SplitView.Content> |
574 | | - <SplitView.Pane> |
575 | | - <Grid x:Name="DrivesListGrid" x:Load="{x:Bind drivesListVis}" Grid.Column="1"> |
576 | | - <StackPanel Orientation="Vertical"> |
577 | | - <TextBlock Margin="0,0,0,0" FontFamily="Segoe UI" FontSize="20" Text="Drives" HorizontalAlignment="Stretch" VerticalAlignment="Top"/> |
578 | | - <ListView IsItemClickEnabled="True" ItemsSource="{x:Bind local:App.foundDrives}" Name="DriveDetailsView" HorizontalAlignment="Stretch" Padding="0,0,0,0" VerticalAlignment="Top" Margin="0,0,0,0"> |
579 | | - <ListView.ItemTemplate> |
580 | | - <DataTemplate> |
581 | | - <Grid Padding="5,10" Tag="{Binding tag}"> |
582 | | - <StackPanel Spacing="10" Orientation="Horizontal"> |
583 | | - <FontIcon FontSize="36" Glyph="{Binding glyph}"/> |
584 | | - <StackPanel Spacing="2" Orientation="Vertical"> |
585 | | - <TextBlock x:Name="DriveName" Text="{Binding driveText}"/> |
586 | | - <ProgressBar Width="175" Visibility="{Binding progressBarVisibility}" Maximum="{Binding maxSpace}" Value="{Binding spaceUsed}"/> |
587 | | - <TextBlock Visibility="{Binding progressBarVisibility}" Text="{Binding spaceText}"/> |
588 | | - </StackPanel> |
589 | | - </StackPanel> |
590 | | - </Grid> |
591 | | - </DataTemplate> |
592 | | - </ListView.ItemTemplate> |
593 | | - </ListView> |
594 | | - </StackPanel> |
595 | | - </Grid> |
596 | | - </SplitView.Pane> |
597 | | - </SplitView> |
| 596 | + |
| 597 | + <Grid x:Name="RecentsListGrid" Grid.Column="0"> |
| 598 | + <StackPanel Orientation="Vertical"> |
| 599 | + <TextBlock Margin="0,0,0,0" FontFamily="Segoe UI" FontSize="20" Text="Recent Items" HorizontalAlignment="Left"/> |
| 600 | + <TextBlock Visibility="{x:Bind local:YourHome.Empty.Visibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="0,24,0,0" Text="Files and folders you've previously accessed will show up here" HorizontalAlignment="Stretch" TextAlignment="Center" TextWrapping="WrapWholeWords" FontSize="14"/> |
| 601 | + <ListView ItemContainerStyle="{StaticResource ListViewItemContainerStyle1}" IsItemClickEnabled="True" IsRightTapEnabled="True" RightTapped="RecentsView_RightTapped" ItemClick="RecentsView_ItemClick" ItemsSource="{x:Bind local:YourHome.recentItemsCollection}" Name="RecentsView" HorizontalAlignment="Stretch" Padding="0,0,0,0" VerticalAlignment="Stretch" Margin="0,0,0,0"> |
| 602 | + <ListView.ItemTemplate> |
| 603 | + <DataTemplate> |
| 604 | + <Grid ColumnSpacing="14" ToolTipService.ToolTip="{Binding path}" Padding="2.5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
| 605 | + <Grid.ContextFlyout> |
| 606 | + <MenuFlyout MenuFlyoutPresenterStyle="{StaticResource MenuFlyoutFluentThemeResources}"> |
| 607 | + <MenuFlyoutItem Click="mfi_RemoveOneItem_Click" Icon="Remove" Text="Remove this item" x:Name="mfi_RemoveOneItem"/> |
| 608 | + <MenuFlyoutItem Click="MenuFlyoutItem_Click" Icon="Delete" Text="Clear all items"/> |
| 609 | + </MenuFlyout> |
| 610 | + </Grid.ContextFlyout> |
| 611 | + <Grid.ColumnDefinitions> |
| 612 | + <ColumnDefinition Width="Auto"/> |
| 613 | + <ColumnDefinition Width="*"/> |
| 614 | + <ColumnDefinition Width="*" /> |
| 615 | + </Grid.ColumnDefinitions> |
| 616 | + <Grid Grid.Column="0" VerticalAlignment="Stretch" Margin="0, 0, 0, 0"> |
| 617 | + <FontIcon Visibility="{Binding FolderImg}" FontSize="24" Glyph="" FontFamily="Segoe MDL2 Assets" Foreground="#ffe793"/> |
| 618 | + <FontIcon Visibility="{Binding EmptyImgVis}" FontSize="24" Glyph="" FontFamily="Segoe MDL2 Assets"/> |
| 619 | + <Image Visibility="{Binding FileIconVis}" Height="24" Width="24" Source="{Binding FileImg}" Stretch="UniformToFill" /> |
| 620 | + </Grid> |
| 621 | + <TextBlock Grid.Column="1" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Text="{Binding name}" VerticalAlignment="Center"/> |
| 622 | + <TextBlock Foreground="DimGray" FontSize="10" Grid.Column="2" Margin="0,0,0,0" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Text="{Binding path}" VerticalAlignment="Center"/> |
| 623 | + </Grid> |
| 624 | + </DataTemplate> |
| 625 | + </ListView.ItemTemplate> |
| 626 | + </ListView> |
| 627 | + </StackPanel> |
| 628 | + </Grid> |
598 | 629 | </StackPanel> |
599 | 630 | </Grid> |
600 | 631 | </ScrollViewer> |
|
0 commit comments