<UserControl x:Class="VIZ.Package.Module.MediaResourceView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:VIZ.Package.Module"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800">

    <Grid Background="Transparent">
        <!-- 媒体资源面板 -->
        <local:MediaResourcePanel>
            <local:MediaResourcePanel.FolderContextMenu>
                <ContextMenu>
                    <MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFolderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="创建文件夹" Command="{Binding Path=PlacementTarget.DataContext.CreateFloderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="删除文件夹" Command="{Binding Path=PlacementTarget.DataContext.DeleteFloderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="移入文件夹" Command="{Binding Path=PlacementTarget.DataContext.MoveFloderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="导出素材" Command="{Binding Path=PlacementTarget.DataContext.ExportFolderFilesCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                </ContextMenu>
            </local:MediaResourcePanel.FolderContextMenu>
            <local:MediaResourcePanel.FileContextMenu>
                <ContextMenu>
                    <MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="添加文件" Command="{Binding Path=PlacementTarget.DataContext.CreateFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="删除文件" Command="{Binding Path=PlacementTarget.DataContext.DeleteFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="移动文件" Command="{Binding Path=PlacementTarget.DataContext.MoveFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="导出素材" Command="{Binding Path=PlacementTarget.DataContext.ExportFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>

                    <MenuItem Header="编辑图片" Command="{Binding Path=PlacementTarget.DataContext.EditImageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <Separator/>
                    <MenuItem Header="文件列表" Command="{Binding Path=PlacementTarget.DataContext.FilesListCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                </ContextMenu>
            </local:MediaResourcePanel.FileContextMenu>

            <local:MediaResourcePanel.FileListContextMenu>
                <ContextMenu>
                    <MenuItem Header="名称排序" Command="{Binding Path=PlacementTarget.DataContext.SortFileNameCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <MenuItem Header="日期排序" Command="{Binding Path=PlacementTarget.DataContext.SortDateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <Separator/>
                    <MenuItem Header="图片列表" Command="{Binding Path=PlacementTarget.DataContext.ShowImageListCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                </ContextMenu>
            </local:MediaResourcePanel.FileListContextMenu>
        </local:MediaResourcePanel>



    </Grid>
</UserControl>