<UserControl x:Class="VIZ.Package.Module.GHSceneView"
             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"
             xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance Type=local:GHSceneViewModel}" 
             d:DesignHeight="450" d:DesignWidth="800">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/VIZ.Package.Module.Resource;component/Style/Button/Button_Default.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>

            <core:ObjectNotNull2BoolConverter x:Key="ObjectNotNull2BoolConverter"></core:ObjectNotNull2BoolConverter>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
        </Grid.RowDefinitions>
        <!-- GH资源面板 -->
        <local:GHResourcePanel  FileSelectionMode="Multiple">
            <local:GHResourcePanel.FolderContextMenu>
                <ContextMenu>
                    <MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFolderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                </ContextMenu>
            </local:GHResourcePanel.FolderContextMenu>
            <local:GHResourcePanel.FileContextMenu>
                <ContextMenu>
                    <MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                    <Separator/>
                    <MenuItem Header="添加至模板列表" Command="{Binding Path=PlacementTarget.DataContext.AddSceneTemplateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
                </ContextMenu>
            </local:GHResourcePanel.FileContextMenu>
        </local:GHResourcePanel>
        <!-- 按钮组 -->
        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0">
            <Button Content="添加至模板列表" Width="120" Height="30" Style="{StaticResource Button_Main}"
                    Command="{Binding Path=AddSceneTemplateCommand}"
                    IsEnabled="{Binding Path=SelectedFileModel,Mode=OneWay,Converter={StaticResource ObjectNotNull2BoolConverter}}"></Button>
        </StackPanel>
    </Grid>
</UserControl>
