Commit 143b88fa by liulongfei

场景打开消息

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