Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.TVP
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.TVP
Commits
7afb1f14
Commit
7afb1f14
authored
Dec 22, 2022
by
wangonghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
本地资源开发
parent
c25d702d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
157 additions
and
1 deletions
+157
-1
VIZ.TVP.Domain/Model/Resource/LF/LFResourceFileModel.cs
+12
-0
VIZ.TVP.Domain/Model/Resource/LF/LFResourceFolderModel.cs
+13
-0
VIZ.TVP.Domain/VIZ.TVP.Domain.csproj
+2
-0
VIZ.TVP.Module/Resource/LocalResource/View/LocalResourceView.xaml
+130
-1
VIZ.TVP.Module/Resource/LocalResource/ViewModel/LocalResourceViewModel.cs
+0
-0
No files found.
VIZ.TVP.Domain/Model/Resource/LF/LFResourceFileModel.cs
0 → 100644
View file @
7afb1f14
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
{
}
}
VIZ.TVP.Domain/Model/Resource/LF/LFResourceFolderModel.cs
0 → 100644
View file @
7afb1f14
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
{
}
}
VIZ.TVP.Domain/VIZ.TVP.Domain.csproj
View file @
7afb1f14
...
...
@@ -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" />
...
...
VIZ.TVP.Module/Resource/LocalResource/View/LocalResourceView.xaml
View file @
7afb1f14
...
...
@@ -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"
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>
VIZ.TVP.Module/Resource/LocalResource/ViewModel/LocalResourceViewModel.cs
View file @
7afb1f14
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment