Commit 7afb1f14 by wangonghui

本地资源开发

parent c25d702d
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain.Model.Resource.LF
{
public class LFResourceFileModel: ResourceFileModelBase
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain.Model.Resource.LF
{
public class LFResourceFolderModel: ResourceFolderModelBase
{
}
}
......@@ -87,6 +87,8 @@
<Compile Include="Model\Project\Program\ProgramListItemModel.cs" />
<Compile Include="Model\Project\Program\ProgramListModel.cs" />
<Compile Include="Model\Project\Program\ProgramTemplateModel.cs" />
<Compile Include="Model\Resource\LF\LFResourceFileModel.cs" />
<Compile Include="Model\Resource\LF\LFResourceFolderModel.cs" />
<Compile Include="Model\TVPConnection\ITVPEndpointManager.cs" />
<Compile Include="Model\TVPConnection\TVPConnectionGroupModel.cs" />
<Compile Include="Model\TVPConnection\TVPConnectionModel.cs" />
......
......@@ -3,10 +3,139 @@
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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:local="clr-namespace:VIZ.TVP.Module"
mc:Ignorable="d"
xmlns:domain="clr-namespace:VIZ.TVP.Domain;assembly=VIZ.TVP.Domain"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:LocalResourceViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Module.Resource;component/DevExpreess/GridControl/GridControl_Files.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<fcore:Bitmap2ImageSourceConverter x:Key="Bitmap2ImageSourceConverter"></fcore:Bitmap2ImageSourceConverter>
</ResourceDictionary>
</UserControl.Resources>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<Grid>
<TextBlock Text="本地资源" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="36" Foreground="Red"></TextBlock>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="240" MaxWidth="400"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 资源文件夹 -->
<dxg:TreeViewControl ItemsSource="{Binding Path=FolderModels}" Margin="0,0,6,0" Grid.Row="1"
SelectedItem="{Binding Path=SelectedFolderModel,Mode=TwoWay}"
SelectionMode="Row" ShowNodeImages="True" ShowSearchPanel="False"
ExpandStateFieldName="IsExpand"
AllowEditing="False" TreeViewFieldName="Name" ChildNodesPath="Children">
<dxg:TreeViewControl.ContextMenu>
<ContextMenu>
<MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFolderCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
</ContextMenu>
</dxg:TreeViewControl.ContextMenu>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="NodeDoubleClick" PassEventArgsToCommand="True" Command="{Binding Path=FolderExpandCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<dxg:TreeViewControl.NodeImageSelector>
<local:ResourceFolderNodeImageSelector Folder="/VIZ.TVP.Module.Resource;component/Icons/folder_24x24.png"
Project="/VIZ.TVP.Module.Resource;component/Icons/project_24x24.png"></local:ResourceFolderNodeImageSelector>
</dxg:TreeViewControl.NodeImageSelector>
</dxg:TreeViewControl>
<!-- 文件夹等待 -->
<dx:WaitIndicator DeferedVisibility="{Binding IsFolderLoading}" Content="Loading..." Grid.Row="1" Margin="0,0,6,0" />
<GridSplitter HorizontalAlignment="Right" Width="4" Grid.Row="1"></GridSplitter>
<!-- 资源文件 -->
<StackPanel Grid.Column="1" Orientation="Horizontal">
<RadioButton Height="30" Width="60" Content="All" IsChecked="True">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=FileFilterCommand}" CommandParameter="{x:Static Member=domain:ResourceFileType.None}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</RadioButton>
<RadioButton Height="30" Width="60" Content="场景">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=FileFilterCommand}" CommandParameter="{x:Static Member=domain:ResourceFileType.SCENE}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</RadioButton>
<RadioButton Height="30" Width="60" Content="图片">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=FileFilterCommand}" CommandParameter="{x:Static Member=domain:ResourceFileType.IMAGE}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</RadioButton>
<RadioButton Height="30" Width="60" Content="视频">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=FileFilterCommand}" CommandParameter="{x:Static Member=domain:ResourceFileType.Video}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</RadioButton>
</StackPanel>
<dxg:GridControl x:Name="fileGrid" Grid.Column="1" ShowBorder="False" Grid.Row="1"
CustomRowFilterCommand="{Binding Path=FileRowFilterCommand}"
ItemsSource="{Binding Path=FileModels}"
SelectedItem="{Binding Path=SelectedFileModel,Mode=TwoWay}">
<dxg:GridControl.Resources>
<!-- 定义Card模板 -->
<DataTemplate x:Key="CardTemplate">
<Grid Width="160" ClipToBounds="False" UseLayoutRounding="True">
<Grid.RowDefinitions>
<RowDefinition Height="90" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Image Source="{Binding Path=Row.ThumbnailBitmap,Converter={StaticResource Bitmap2ImageSourceConverter}}"></Image>
<TextBlock Grid.Row="1" TextAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" HorizontalAlignment="Center"
Text="{Binding Path=Row.Name}" ToolTip="{Binding Path=Row.Name}" Margin="0,5,0,0"/>
</Grid>
</DataTemplate>
</dxg:GridControl.Resources>
<dxg:GridControl.ContextMenu>
<ContextMenu>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Opened" Command="{Binding Path=FileContextMenuOpendCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator/>
<MenuItem Header="添加至场景模板" Command="{Binding Path=PlacementTarget.DataContext.AddProgramTemplateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
</ContextMenu>
</dxg:GridControl.ContextMenu>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Name" AllowColumnFiltering="False" AllowEditing="False" ReadOnly="True"></dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:CardView IsColumnChooserVisible="False"
SeparatorThickness="0"
CardLayout="Rows"
ShowCardExpandButton="False"
ShowColumnHeaders="False"
ShowFilterPanelMode="Never"
ShowGroupedColumns="False"
ShowGroupPanel="False"
SearchPanelHighlightResults="False"
SearchPanelAllowFilter="True"
ShowSearchPanelMode="Never"
SearchColumns="Name"
NavigationStyle="Row"
CardTemplate="{StaticResource CardTemplate}"/>
</dxg:GridControl.View>
</dxg:GridControl>
<!-- 文件等待 -->
<dx:WaitIndicator DeferedVisibility="{Binding IsFileLoading}" Content="Loading..." Grid.Column="1" Grid.Row="1" />
</Grid>
</UserControl>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment