Commit 143b88fa by liulongfei

场景打开消息

parent 56635f17
...@@ -7,9 +7,9 @@ using System.Threading.Tasks; ...@@ -7,9 +7,9 @@ using System.Threading.Tasks;
namespace VIZ.Package.Domain namespace VIZ.Package.Domain
{ {
/// <summary> /// <summary>
/// 页切换命令 /// 页打开消息
/// </summary> /// </summary>
public class PageChangedMessage public class PageOpenMessage
{ {
/// <summary> /// <summary>
/// 页 /// 页
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<Compile Include="ApplicationDomainEx.cs" /> <Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Enum\ModulePluginIds.cs" /> <Compile Include="Enum\ModulePluginIds.cs" />
<Compile Include="Enum\ViewServiceKeys.cs" /> <Compile Include="Enum\ViewServiceKeys.cs" />
<Compile Include="Message\Page\PageChangedMessage.cs" /> <Compile Include="Message\Page\PageOpenMessage.cs" />
<Compile Include="Message\Page\PageInitedMessage.cs" /> <Compile Include="Message\Page\PageInitedMessage.cs" />
<Compile Include="Message\Project\ProjectSaveMessage.cs" /> <Compile Include="Message\Project\ProjectSaveMessage.cs" />
<Compile Include="Message\Project\ProjectCloseMessage.cs" /> <Compile Include="Message\Project\ProjectCloseMessage.cs" />
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
SelectedItem="{Binding Path=SelectedPageGroupModel,Mode=TwoWay}"> SelectedItem="{Binding Path=SelectedPageGroupModel,Mode=TwoWay}">
<dx:DXTabControl.ContextMenu> <dx:DXTabControl.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem Header="打开" Command="{Binding Path=PlacementTarget.DataContext.OpenPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator></Separator>
<MenuItem Header="新建分组" Command="{Binding Path=PlacementTarget.DataContext.AddGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="新建分组" Command="{Binding Path=PlacementTarget.DataContext.AddGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="重命名分组" Command="{Binding Path=PlacementTarget.DataContext.RenameGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="重命名分组" Command="{Binding Path=PlacementTarget.DataContext.RenameGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator></Separator> <Separator></Separator>
...@@ -95,7 +97,7 @@ ...@@ -95,7 +97,7 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
NavigationStyle="Cell" NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDragDrop="True"
ShowFilterPanelMode="Never" ShowFilterPanelMode="Never"
...@@ -104,6 +106,9 @@ ...@@ -104,6 +106,9 @@
ShowFixedTotalSummary="False" ShowFixedTotalSummary="False"
ShowDragDropHint="False" ShowDragDropHint="False"
ShowTargetInfoInDragDropHint="False"> ShowTargetInfoInDragDropHint="False">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="RowDoubleClick" Command="{Binding ElementName=uc, Path=DataContext.OpenPageCommand,Mode=TwoWay}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</dxg:TableView> </dxg:TableView>
</dxg:GridControl.View> </dxg:GridControl.View>
</dxg:GridControl> </dxg:GridControl>
......
...@@ -43,6 +43,7 @@ namespace VIZ.Package.Module ...@@ -43,6 +43,7 @@ namespace VIZ.Package.Module
this.AddGroupCommand = new VCommand(this.AddGroup); this.AddGroupCommand = new VCommand(this.AddGroup);
this.RenameGroupCommand = new VCommand(this.RenameGroup); this.RenameGroupCommand = new VCommand(this.RenameGroup);
this.DeleteGroupCommand = new VCommand(this.DeleteGroup); this.DeleteGroupCommand = new VCommand(this.DeleteGroup);
this.OpenPageCommand = new VCommand(this.OpenPage);
} }
/// <summary> /// <summary>
...@@ -145,15 +146,7 @@ namespace VIZ.Package.Module ...@@ -145,15 +146,7 @@ namespace VIZ.Package.Module
public PageModel SelectedPageModel public PageModel SelectedPageModel
{ {
get { return selectedPageModel; } get { return selectedPageModel; }
set set { selectedPageModel = value; this.RaisePropertyChanged(nameof(SelectedPageModel)); }
{
selectedPageModel = value;
this.RaisePropertyChanged(nameof(SelectedPageModel));
PageChangedMessage msg = new PageChangedMessage();
msg.Page = value;
ApplicationDomainEx.MessageManager.Send(msg);
}
} }
#endregion #endregion
...@@ -246,6 +239,29 @@ namespace VIZ.Package.Module ...@@ -246,6 +239,29 @@ namespace VIZ.Package.Module
#endregion #endregion
#region OpenPageCommand -- 打开页命令
/// <summary>
/// 打开场景页命令
/// </summary>
public VCommand OpenPageCommand { get; set; }
/// <summary>
/// 打开场景页
/// </summary>
private void OpenPage()
{
if (this.SelectedPageModel == null)
return;
ApplicationDomainEx.CurrentPage = this.SelectedPageModel;
PageOpenMessage msg = new PageOpenMessage();
msg.Page = this.SelectedPageModel;
ApplicationDomainEx.MessageManager.Send(msg);
}
#endregion
// ====================================================================================== // ======================================================================================
// Message // Message
// ====================================================================================== // ======================================================================================
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
SelectedItem="{Binding Path=SelectedSceneTemplateModel,Mode=TwoWay}"> SelectedItem="{Binding Path=SelectedSceneTemplateModel,Mode=TwoWay}">
<dxg:GridControl.ContextMenu> <dxg:GridControl.ContextMenu>
<ContextMenu> <ContextMenu>
<MenuItem Header="打开" Command="{Binding Path=PlacementTarget.DataContext.OpenScenePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator></Separator>
<MenuItem Header="添加至节目单" Command="{Binding Path=PlacementTarget.DataContext.SceneTemplateAddToPageGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="添加至节目单" Command="{Binding Path=PlacementTarget.DataContext.SceneTemplateAddToPageGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="更新模板" Command="{Binding Path=PlacementTarget.DataContext.SceneTemplateUpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="更新模板" Command="{Binding Path=PlacementTarget.DataContext.SceneTemplateUpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator></Separator> <Separator></Separator>
...@@ -68,7 +70,7 @@ ...@@ -68,7 +70,7 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
NavigationStyle="Cell" NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDragDrop="True"
ShowBandsPanel="False" ShowBandsPanel="False"
...@@ -76,6 +78,9 @@ ...@@ -76,6 +78,9 @@
ShowFixedTotalSummary="False" ShowFixedTotalSummary="False"
ShowDragDropHint="False" ShowDragDropHint="False"
ShowTargetInfoInDragDropHint="false"> ShowTargetInfoInDragDropHint="false">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="RowDoubleClick" Command="{Binding Path=OpenScenePageCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</dxg:TableView> </dxg:TableView>
</dxg:GridControl.View> </dxg:GridControl.View>
</dxg:GridControl> </dxg:GridControl>
...@@ -111,7 +116,7 @@ ...@@ -111,7 +116,7 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
NavigationStyle="Cell" NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDragDrop="True"
ShowBandsPanel="False" ShowBandsPanel="False"
......
...@@ -41,7 +41,7 @@ namespace VIZ.Package.Module ...@@ -41,7 +41,7 @@ namespace VIZ.Package.Module
private void initCommand() private void initCommand()
{ {
this.SceneTemplateAddToPageGroupCommand = new VCommand(this.SceneTemplateAddToPageGroup); this.SceneTemplateAddToPageGroupCommand = new VCommand(this.SceneTemplateAddToPageGroup);
this.OpenScenePageCommand = new VCommand(this.OpenScenePage);
} }
/// <summary> /// <summary>
...@@ -184,6 +184,30 @@ namespace VIZ.Package.Module ...@@ -184,6 +184,30 @@ namespace VIZ.Package.Module
#endregion #endregion
#region OpenScenePageCommand -- 打开场景页命令
/// <summary>
/// 打开场景页命令
/// </summary>
public VCommand OpenScenePageCommand { get; set; }
/// <summary>
/// 打开场景页
/// </summary>
private void OpenScenePage()
{
if (this.SelectedSceneTemplateModel == null)
return;
ApplicationDomainEx.CurrentPage = this.SelectedSceneTemplateModel;
PageOpenMessage msg = new PageOpenMessage();
msg.Page = this.SelectedSceneTemplateModel;
ApplicationDomainEx.MessageManager.Send(msg);
}
#endregion
// ====================================================================================== // ======================================================================================
// Message // Message
// ====================================================================================== // ======================================================================================
......
...@@ -62,7 +62,7 @@ namespace VIZ.Package.Module ...@@ -62,7 +62,7 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void initMessage() private void initMessage()
{ {
ApplicationDomainEx.MessageManager.Register<PageChangedMessage>(this, this.OnPageChangedMessage); ApplicationDomainEx.MessageManager.Register<PageOpenMessage>(this, this.OnPageOpenMessage);
} }
// ================================================================================ // ================================================================================
...@@ -449,10 +449,10 @@ namespace VIZ.Package.Module ...@@ -449,10 +449,10 @@ namespace VIZ.Package.Module
// ================================================================================ // ================================================================================
/// <summary> /// <summary>
/// 页切换消息 /// 页打开消息
/// </summary> /// </summary>
/// <param name="msg">消息</param> /// <param name="msg">消息</param>
private void OnPageChangedMessage(PageChangedMessage msg) private void OnPageOpenMessage(PageOpenMessage msg)
{ {
// 引擎未准备好 || 当前没有选中的节目单项目 则不处理 // 引擎未准备好 || 当前没有选中的节目单项目 则不处理
if (!this.IsEngineReady || ApplicationDomainEx.CurrentPage == null) if (!this.IsEngineReady || ApplicationDomainEx.CurrentPage == null)
......
...@@ -24,6 +24,7 @@ namespace VIZ.Package.Service ...@@ -24,6 +24,7 @@ namespace VIZ.Package.Service
if (conn == null) if (conn == null)
throw new ArgumentNullException(nameof(conn)); throw new ArgumentNullException(nameof(conn));
// 需要等待结果
conn.EndpointManager.Send($"RENDERER*{layer} SET_OBJECT SCENE*{scene}"); conn.EndpointManager.Send($"RENDERER*{layer} SET_OBJECT SCENE*{scene}");
} }
......
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