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
7718819d
Commit
7718819d
authored
Feb 21, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
插件添加页打开接口
parent
cd36a27d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
1 deletions
+64
-1
VIZ.Package.Domain/Plugin/IPluginView.cs
+6
-0
VIZ.Package.Module/ControlObject/FieldTree/ViewModel/FieldTreeViewModel.cs
+17
-1
VIZ.Package.Module/Plugin/Service/IPluginService.cs
+8
-0
VIZ.Package.Module/Plugin/ViewModel/PluginViewModel.cs
+24
-0
VIZ.Package.TestPlugin/Page/TestPageView.xaml.cs
+9
-0
No files found.
VIZ.Package.Domain/Plugin/IPluginView.cs
View file @
7718819d
...
...
@@ -52,5 +52,11 @@ namespace VIZ.Package.Domain
/// </summary>
/// <param name="conn">连接</param>
void
PreviewOut
(
ConnModel
conn
);
/// <summary>
/// 打开页后触发
/// </summary>
/// <param name="page">页</param>
void
PageOpend
(
PageModel
page
);
}
}
VIZ.Package.Module/ControlObject/FieldTree/ViewModel/FieldTreeViewModel.cs
View file @
7718819d
using
DevExpress.Xpf.Grid.TreeList
;
using
DevExpress.Mvvm.POCO
;
using
DevExpress.Xpf.Grid.TreeList
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -164,6 +165,21 @@ namespace VIZ.Package.Module
// 将当前值上至预览
this
.
vizCommandControlObjectService
.
SetControlObject
(
ApplicationDomainEx
.
PreviewConn
,
this
.
ControlObject
);
// 插件处理
PageModel
pageModel
=
msg
.
Page
as
PageModel
;
if
(
pageModel
==
null
||
string
.
IsNullOrWhiteSpace
(
pageModel
.
PluginID
))
return
;
IPluginService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
if
(
service
==
null
)
return
;
IPluginView
pluginView
=
service
.
GetPluginView
(
pageModel
);
if
(
pluginView
==
null
)
return
;
pluginView
.
PageOpend
(
pageModel
);
},
final
:
()
=>
{
WPFHelper
.
BeginInvoke
(()
=>
...
...
VIZ.Package.Module/Plugin/Service/IPluginService.cs
View file @
7718819d
...
...
@@ -34,6 +34,14 @@ namespace VIZ.Package.Module
List
<
IPluginView
>
GetPluginViews
();
/// <summary>
/// 根据页模型获取插件视图
/// </summary>
/// <param name="page">页模型</param>
/// <returns>插件视图</returns>
IPluginView
GetPluginView
(
PageModel
page
);
/// <summary>
/// 获取插件视图
/// </summary>
/// <typeparam name="T">插件视图类型</typeparam>
...
...
VIZ.Package.Module/Plugin/ViewModel/PluginViewModel.cs
View file @
7718819d
...
...
@@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Documents
;
using
VIZ.Framework.Common
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
...
...
@@ -305,6 +306,29 @@ namespace VIZ.Package.Module
}
/// <summary>
/// 根据页模型获取插件视图
/// </summary>
/// <param name="page">页模型</param>
/// <returns>插件视图</returns>
public
IPluginView
GetPluginView
(
PageModel
page
)
{
foreach
(
PluginNavigationConfig
config
in
this
.
ItemsSource
)
{
if
(
config
.
PageModel
!=
page
)
continue
;
config
.
View
.
TryGetTarget
(
out
object
target
);
if
(
target
==
null
)
return
null
;
return
target
as
IPluginView
;
}
return
null
;
}
/// <summary>
/// 获取插件视图
/// </summary>
/// <typeparam name="T">插件视图类型</typeparam>
...
...
VIZ.Package.TestPlugin/Page/TestPageView.xaml.cs
View file @
7718819d
...
...
@@ -119,5 +119,14 @@ namespace VIZ.Package.TestPlugin
/// </summary>
public
void
Dispose
()
{
}
/// <summary>
/// 打开页后触发
/// </summary>
/// <param name="page">页</param>
public
void
PageOpend
(
PageModel
page
)
{
}
}
}
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