DirectorySelector.xaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <UserControl x:Class="ConfigFileManager.Controls.FileSelector.DirectorySelector"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ConfigFileManager.Controls.FileSelector"
  7. mc:Ignorable="d"
  8. x:Name="This"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <UserControl.Resources>
  11. <ResourceDictionary Source="/UICommon;component/Resources.xaml"/>
  12. </UserControl.Resources>
  13. <Grid Background="Transparent">
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="auto"/>
  16. <RowDefinition Height="0"/>
  17. <RowDefinition/>
  18. </Grid.RowDefinitions>
  19. <Grid>
  20. <Button Background="Transparent" BorderBrush="{StaticResource ThemeColor}" TextElement.Foreground="{StaticResource ThemeColor}"
  21. Click="Button_Click_1" VerticalAlignment="Bottom" Height="24" Margin="4" Width="60" HorizontalAlignment="Left" Panel.ZIndex="1">
  22. 返回上级
  23. </Button>
  24. <TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="14"
  25. Foreground="{StaticResource ThemeColor}" Text="{Binding ElementName=This, Path=Title}"/>
  26. </Grid>
  27. <ScrollViewer Grid.Row="2" Margin="4">
  28. <ItemsControl ItemsSource="{Binding ElementName=This, Path=Displays}">
  29. <ItemsControl.ItemTemplate>
  30. <DataTemplate>
  31. <Button Background="Transparent" Click="Button_Click" BorderThickness="0" CommandParameter="{Binding}" VerticalAlignment="Top">
  32. <local:FileVertical ImageSource="{Binding ImageSource}" FileName="{Binding Name}" FileType="{Binding FileType}"
  33. Background="Transparent" TextElement.Foreground="{StaticResource ThemeColor}" Width="96"/>
  34. </Button>
  35. </DataTemplate>
  36. </ItemsControl.ItemTemplate>
  37. <ItemsControl.ItemsPanel>
  38. <ItemsPanelTemplate>
  39. <WrapPanel />
  40. </ItemsPanelTemplate>
  41. </ItemsControl.ItemsPanel>
  42. </ItemsControl>
  43. </ScrollViewer>
  44. </Grid>
  45. </UserControl>