107 lines
7.0 KiB
XML
107 lines
7.0 KiB
XML
<UserControl x:Class="HeBianGu.App.Disk.ExplorerControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:h="https://github.com/HeBianGu"
|
|
xmlns:local="clr-namespace:HeBianGu.App.Disk"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:behaviors="clr-namespace:Hopetry.Provider.Behaviors"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
mc:Ignorable="d">
|
|
<Grid>
|
|
<DockPanel>
|
|
<StackPanel Height="{DynamicResource {x:Static h:SystemKeys.RowHeight}}"
|
|
Background="{DynamicResource {x:Static h:BrushKeys.Dark0_3}}"
|
|
DockPanel.Dock="Top"
|
|
Orientation="Horizontal">
|
|
|
|
<h:Interaction.Behaviors>
|
|
<h:LoadAnimationBehavior End="1" EndValue="0"
|
|
IsUseAll="True"
|
|
LoadAnimationType="HorizontalAlignment"
|
|
Split="0.2"
|
|
StartValue="1000" />
|
|
</h:Interaction.Behaviors>
|
|
|
|
<Button h:Cattach.Icon="" Command="{Binding UploadCommand}" Content="多文件上传" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
|
<Button h:Cattach.Icon="" Command="{Binding UploadCommand1}" Content="文件夹上传" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
|
<Button h:Cattach.Icon="" Command="{Binding DownloadCommand}" Content="下载" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
|
<!--<Button h:Cattach.Icon="" Content="分享" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />-->
|
|
<Button h:Cattach.Icon="" Command="{Binding DeleteFolderCommand}" Content="删除" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
|
<Button h:Cattach.Icon="" Command="{Binding CreateFolderCommand}" Content="新建文件夹" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
|
<TextBlock Text="{Binding StatusMessage}" DockPanel.Dock="Right" VerticalAlignment="Center"
|
|
Margin="200,0,0,0" Width="150" />
|
|
<!--<Button h:Cattach.Icon="" Content="离线下载" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />-->
|
|
</StackPanel>
|
|
|
|
<h:Explorer Margin="0,0,10,0" CurrentPath="{Binding CurrentMinIOPath, Mode=TwoWay}"
|
|
Style="{DynamicResource {x:Static h:Explorer.DefaultKey}}"
|
|
IsReadOnly="False" SelectionMode="Extended"
|
|
EnableRowVirtualization="true"
|
|
EnableColumnVirtualization="true"
|
|
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
|
SelectionUnit="FullRow"
|
|
CanUserAddRows="False">
|
|
<h:Interaction.Behaviors>
|
|
<!--<h:LoadAnimationBehavior End="0.05"
|
|
EndValue="1"
|
|
IsUseAll="True"
|
|
LoadAnimationType="Opactiy"
|
|
Split="0.02"
|
|
StartValue="0" />-->
|
|
<behaviors:ExplorerMinIOBehavior UseMinIO="True" RootDisplayName="全部文件" StatusMessage="{Binding StatusMessage, Mode=OneWayToSource}" />
|
|
<behaviors:MinIOSearchBehavior/>
|
|
</h:Interaction.Behaviors>
|
|
|
|
<!--<i:Interaction.Behaviors>
|
|
<behaviors:ExplorerMinIOBehavior UseMinIO="True" />
|
|
</i:Interaction.Behaviors>-->
|
|
|
|
<h:Explorer.Columns>
|
|
<DataGridTemplateColumn Width="50" Header="" >
|
|
<DataGridTemplateColumn.HeaderTemplate>
|
|
<DataTemplate>
|
|
<!--<CheckBox Foreground="{Binding RelativeSource={RelativeSource AncestorType=DataGridColumnHeader}, Path=Foreground}"-->
|
|
<!--Command="{Binding DataContext.SelectAllCommand,RelativeSource={RelativeSource AncestorType=DataGrid}}"/>-->
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.HeaderTemplate>
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<CheckBox Margin="0,0"
|
|
HorizontalAlignment="Center"
|
|
Foreground="{Binding RelativeSource={RelativeSource AncestorType=DataGridCell}, Path=Foreground}"
|
|
IsChecked="{Binding IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
Command="{Binding DataContext.SelectItemsCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
|
CommandParameter="{Binding}" />
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
|
|
<DataGridTemplateColumn Width="3*" Header="文件名" IsReadOnly="False">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Margin="5" Source="{Binding Logo, Converter={x:Static h:XConverter.IconToImageSourceConverter}}" />
|
|
<TextBlock Foreground="{Binding RelativeSource={RelativeSource AncestorType=DataGridCell}, Path=Foreground}" Style="{StaticResource {x:Static h:TextBlockKeys.Default}}" Text="{Binding DisplayName}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
<DataGridTemplateColumn.CellEditingTemplate>
|
|
<DataTemplate>
|
|
<TextBox Text="{Binding DisplayName, UpdateSourceTrigger=PropertyChanged}"
|
|
BorderThickness="0" Background="Transparent" IsReadOnly="{Binding IsRenaming}"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellEditingTemplate>
|
|
</DataGridTemplateColumn>
|
|
|
|
<DataGridTextColumn Width="*" Binding="{Binding Model.LastWriteTime, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" IsReadOnly="True" Header="修改时间" />
|
|
<DataGridTextColumn Width="*" Binding="{Binding Model.Size}" IsReadOnly="True" Header="大小" />
|
|
</h:Explorer.Columns>
|
|
</h:Explorer>
|
|
</DockPanel>
|
|
</Grid>
|
|
</UserControl>
|