SCSF:通过单击按钮从另一个视图显示视图

发布于 2024-08-03 04:08:33 字数 410 浏览 3 评论 0原文

我在 SCSF 面临一个问题。

我有两个工作区

  1. MdiWorkspace
  2. DeckWorkspace

我在模块

  1. 查看器中有两个视图(在 mdiworkspace 中显示)
  2. 属性查看器(在 DeckWorkspace 中)

在查看器中 我在工具栏中有一个按钮,其目的是显示 PropertyViewer (另一个视图)。

我如何在 Deckworkspace 中针对按钮单击事件显示此 PropertyViewer。

注意: 我没有使用 Command[CommandName].AddInvoker(control, "click:) 和 CommandHandler

i am facing one problem in SCSF.

I have two workspaces

  1. MdiWorkspace
  2. DeckWorkspace

i have two views in a module

  1. Viewer (display in mdiworkspace)
  2. Property Viewer (in deckworkspace)

in Viewer i have a button in toolbar whose purpose is to display PropertyViewer (another View).

how can i display this PropertyViewer in deckworkspace agaist button click event.

NOTE: i am not using Command[CommandName].AddInvoker(control, "click:) and CommandHandler

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老旧海报 2024-08-10 04:08:33

我假设您的工具栏位于实现 MVP 模式的 SmartPart 中。让 SmartPart 中的按钮单击事件处理程序触发其演示者将处理的事件。您的演示者代码将如下所示:

// Presenter code

protected override void OnViewSet()
{
   this.View.ToolbarButtonClick += View_ToolbarButtonClick;
}

public void View_ToolbarButtonClick(object sender, EventArgs e)
{
    // remove the handler so the property viewer 
    // will only be added the first time
    this.View.OnToolbarButtonClick -= View_ToolbarButtonClick;

    var propertyView = new PropertyViewer();
    this.WorkItem.Workspaces[WorkspaceNames.MyDeckWorkspace].Show(propertyView);
}

I'm going to assume your toolbar sits in a SmartPart that implements the MVP pattern. Have the button click event handler in the SmartPart fire an event that its presenter will handle. Your presenter code would look like this:

// Presenter code

protected override void OnViewSet()
{
   this.View.ToolbarButtonClick += View_ToolbarButtonClick;
}

public void View_ToolbarButtonClick(object sender, EventArgs e)
{
    // remove the handler so the property viewer 
    // will only be added the first time
    this.View.OnToolbarButtonClick -= View_ToolbarButtonClick;

    var propertyView = new PropertyViewer();
    this.WorkItem.Workspaces[WorkspaceNames.MyDeckWorkspace].Show(propertyView);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文