Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
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.Package
Commits
57b9c9f5
Commit
57b9c9f5
authored
Feb 15, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场景模板选择页面逻辑调整
parent
ad6b3a81
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
53 deletions
+33
-53
VIZ.Package.Domain/Model/Resource/GH/GHResourceFileModel.cs
+0
-14
VIZ.Package.Module.Resource/Icons/checked_36x36.png
+0
-0
VIZ.Package.Module/Resource/GHResource/Controller/GHResourceFileController.cs
+0
-7
VIZ.Package.Module/Resource/GHResource/View/GHResourcePanel.xaml
+2
-1
VIZ.Package.Module/Resource/GHResource/View/GHSceneView.xaml
+8
-1
VIZ.Package.Module/Resource/GHResource/ViewModel/GHResourcePanelModel.cs
+15
-0
VIZ.Package.Module/Resource/GHResource/ViewModel/GHSceneViewModel.cs
+8
-30
No files found.
VIZ.Package.Domain/Model/Resource/GH/GHResourceFileModel.cs
View file @
57b9c9f5
...
@@ -117,20 +117,6 @@ namespace VIZ.Package.Domain
...
@@ -117,20 +117,6 @@ namespace VIZ.Package.Domain
#
endregion
#
endregion
#
region
IsChecked
--
是否被选中
private
bool
isChecked
;
/// <summary>
/// 是否被选中
/// </summary>
public
bool
IsChecked
{
get
{
return
isChecked
;
}
set
{
isChecked
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsChecked
));
}
}
#
endregion
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// 方法
// 方法
...
...
VIZ.Package.Module.Resource/Icons/checked_36x36.png
View file @
57b9c9f5
3.08 KB
|
W:
|
H:
3.16 KB
|
W:
|
H:
2-up
Swipe
Onion skin
VIZ.Package.Module/Resource/GHResource/Controller/GHResourceFileController.cs
View file @
57b9c9f5
...
@@ -57,16 +57,9 @@ namespace VIZ.Package.Module
...
@@ -57,16 +57,9 @@ namespace VIZ.Package.Module
if
(
folder
==
null
)
if
(
folder
==
null
)
{
{
this
.
ViewModel
.
FileModels
=
null
;
this
.
ViewModel
.
FileModels
=
null
;
this
.
ViewModel
.
SelectedFileModel
=
null
;
return
;
return
;
}
}
// 清除选择
foreach
(
GHResourceFileModel
file
in
folder
.
Files
)
{
file
.
IsChecked
=
false
;
}
// 已经获取过文件
// 已经获取过文件
if
(
folder
.
IsRefreshedFiles
)
if
(
folder
.
IsRefreshedFiles
)
{
{
...
...
VIZ.Package.Module/Resource/GHResource/View/GHResourcePanel.xaml
View file @
57b9c9f5
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<TextBlock Grid.Row="1" TextAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" HorizontalAlignment="Center"
<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"/>
Text="{Binding Path=Row.Name}" ToolTip="{Binding Path=Row.Name}" Margin="0,5,0,0"/>
<CheckBox Style="{StaticResource ResourceKey=CheckBox_Resource}" Grid.RowSpan="2"
<CheckBox Style="{StaticResource ResourceKey=CheckBox_Resource}" Grid.RowSpan="2"
IsChecked="{Binding Path=
Row.IsChecked,Mode=TwoWay}
"></CheckBox>
IsChecked="{Binding Path=
IsSelected,Mode=OneWay}" IsHitTestVisible="False
"></CheckBox>
</Grid>
</Grid>
</DataTemplate>
</DataTemplate>
</resource:ResourceFileSelectionModeConverter.MultipleDataTemplate>
</resource:ResourceFileSelectionModeConverter.MultipleDataTemplate>
...
@@ -94,6 +94,7 @@
...
@@ -94,6 +94,7 @@
SelectionMode="Row"
SelectionMode="Row"
CustomRowFilterCommand="{Binding Path=FileRowFilterCommand}"
CustomRowFilterCommand="{Binding Path=FileRowFilterCommand}"
ItemsSource="{Binding Path=FileModels}"
ItemsSource="{Binding Path=FileModels}"
SelectedItems="{Binding Path=SelectedFileModels,Mode=OneWayToSource}"
SelectedItem="{Binding Path=SelectedFileModel,Mode=TwoWay}">
SelectedItem="{Binding Path=SelectedFileModel,Mode=TwoWay}">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="MouseDoubleClick" Command="{Binding Path=FileDoubleClickCommand}"></dxmvvm:EventToCommand>
<dxmvvm:EventToCommand EventName="MouseDoubleClick" Command="{Binding Path=FileDoubleClickCommand}"></dxmvvm:EventToCommand>
...
...
VIZ.Package.Module/Resource/GHResource/View/GHSceneView.xaml
View file @
57b9c9f5
...
@@ -7,6 +7,10 @@
...
@@ -7,6 +7,10 @@
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
d:DesignHeight="450" d:DesignWidth="800">
<Grid Background="Transparent">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<!-- GH资源面板 -->
<!-- GH资源面板 -->
<local:GHResourcePanel FileSelectionMode="Multiple">
<local:GHResourcePanel FileSelectionMode="Multiple">
<local:GHResourcePanel.FolderContextMenu>
<local:GHResourcePanel.FolderContextMenu>
...
@@ -17,11 +21,14 @@
...
@@ -17,11 +21,14 @@
<local:GHResourcePanel.FileContextMenu>
<local:GHResourcePanel.FileContextMenu>
<ContextMenu>
<ContextMenu>
<MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="取消选择" Command="{Binding Path=PlacementTarget.DataContext.CancelFileSelectedCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator/>
<Separator/>
<MenuItem Header="添加场景模板" Command="{Binding Path=PlacementTarget.DataContext.AddSceneTemplateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="添加场景模板" Command="{Binding Path=PlacementTarget.DataContext.AddSceneTemplateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
</ContextMenu>
</ContextMenu>
</local:GHResourcePanel.FileContextMenu>
</local:GHResourcePanel.FileContextMenu>
</local:GHResourcePanel>
</local:GHResourcePanel>
<!-- 按钮组 -->
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0">
<Button Content="添加模板" Width="100" Height="30" Command="{Binding Path=AddSceneTemplateCommand}"></Button>
</StackPanel>
</Grid>
</Grid>
</UserControl>
</UserControl>
VIZ.Package.Module/Resource/GHResource/ViewModel/GHResourcePanelModel.cs
View file @
57b9c9f5
using
DevExpress.Mvvm.Xpf
;
using
DevExpress.Mvvm.Xpf
;
using
log4net
;
using
log4net
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Linq
;
...
@@ -143,6 +144,20 @@ namespace VIZ.Package.Module
...
@@ -143,6 +144,20 @@ namespace VIZ.Package.Module
#
endregion
#
endregion
#
region
SelectedFileModels
--
选中的文件模型集合
private
IList
selectedFileModels
;
/// <summary>
/// 选中的文件模型集合
/// </summary>
public
IList
SelectedFileModels
{
get
{
return
selectedFileModels
;
}
set
{
selectedFileModels
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
SelectedFileModels
));
}
}
#
endregion
#
region
IsFolderLoading
--
是否正在加载文件夹
#
region
IsFolderLoading
--
是否正在加载文件夹
private
bool
isFolderLoading
;
private
bool
isFolderLoading
;
...
...
VIZ.Package.Module/Resource/GHResource/ViewModel/GHSceneViewModel.cs
View file @
57b9c9f5
using
System
;
using
DevExpress.Xpf.Core
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
@@ -27,7 +28,6 @@ namespace VIZ.Package.Module
...
@@ -27,7 +28,6 @@ namespace VIZ.Package.Module
private
void
InitCommand
()
private
void
InitCommand
()
{
{
this
.
AddSceneTemplateCommand
=
new
VCommand
(
this
.
AddSceneTemplate
);
this
.
AddSceneTemplateCommand
=
new
VCommand
(
this
.
AddSceneTemplate
);
this
.
CancelFileSelectedCommand
=
new
VCommand
(
this
.
CancelFileSelected
);
}
}
// ===========================================================================
// ===========================================================================
...
@@ -46,45 +46,23 @@ namespace VIZ.Package.Module
...
@@ -46,45 +46,23 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
AddSceneTemplate
()
private
void
AddSceneTemplate
()
{
{
if
(
this
.
SelectedFolderModel
==
null
)
if
(
this
.
SelectedFolderModel
==
null
||
this
.
SelectedFileModels
.
Count
==
0
)
{
DXMessageBox
.
Show
(
"请选择场景模板"
);
return
;
return
;
}
IPageTemplateService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageTemplateService
>(
ViewServiceKeys
.
PAGE_TEMPLATE_SERVICE
);
IPageTemplateService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageTemplateService
>(
ViewServiceKeys
.
PAGE_TEMPLATE_SERVICE
);
if
(
service
==
null
)
if
(
service
==
null
)
return
;
return
;
foreach
(
GHResourceFileModel
file
in
this
.
SelectedF
olderModel
.
File
s
)
foreach
(
GHResourceFileModel
file
in
this
.
SelectedF
ileModel
s
)
{
{
if
(!
file
.
IsChecked
)
continue
;
service
.
AddSceneTemplate
(
file
);
service
.
AddSceneTemplate
(
file
);
}
}
}
}
#
endregion
#
endregion
#
region
CancelFileSelectedCommand
--
取消文件选择命令
/// <summary>
/// 取消文件选择命令
/// </summary>
public
VCommand
CancelFileSelectedCommand
{
get
;
set
;
}
/// <summary>
/// 取消文件选择
/// </summary>
private
void
CancelFileSelected
()
{
if
(
this
.
SelectedFolderModel
==
null
)
return
;
foreach
(
GHResourceFileModel
file
in
this
.
SelectedFolderModel
.
Files
)
{
file
.
IsChecked
=
false
;
}
}
#
endregion
}
}
}
}
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