当前位置: 首页>>代码示例>>C#>>正文


C# IEventAggregator.SendMessage方法代码示例

本文整理汇总了C#中IEventAggregator.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# IEventAggregator.SendMessage方法的具体用法?C# IEventAggregator.SendMessage怎么用?C# IEventAggregator.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEventAggregator的用法示例。


在下文中一共展示了IEventAggregator.SendMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StoryTellerTabItem

        public StoryTellerTabItem(IScreen screen, IEventAggregator events)
        {
            _screen = screen;
            _item = new TabItem();

            Func<Action<IScreenConductor>, Action> sendMessage = a => () => events.SendMessage(a);

            _item.Header = new StackPanel().Horizontal()
                .Configure(x =>
                {
                    x.Height = 25;
                })
                .AddText(screen.Title, x => _label = x)
                .Add(new TabCloser(sendMessage(s => s.Close(screen))));

            _label.VerticalAlignment = VerticalAlignment.Center;
            _label.Margin = new Thickness(0, 0, 5, 0);

            _item.Content = new DockPanel().With(screen.View);
            _item.Tag = screen;

            // Sets up a context menu for each tab in the screen that can capture "Close"
            // messages
            _item.ContextMenu = new ContextMenu().Configure(o =>
            {
                o.AddItem("Close", sendMessage(s => s.Close(screen)));
                o.AddItem("Close All But This", sendMessage(s => s.CloseAllBut(screen)));
                o.AddItem("Close All", sendMessage(s => s.CloseAll()));
            });
        }
开发者ID:abombss,项目名称:storyteller,代码行数:30,代码来源:StoryTellerTabItem.cs

示例2: ScreenCollection

        public ScreenCollection(TabControl tabs, IEventAggregator events)
        {
            _tabs = tabs;
            _tabItems.OnMissing = screen => new StoryTellerTabItem(screen, events);

            // Sends a message when the user select a different tab on the screen
            _tabs.SelectionChanged += (s, c) => events.SendMessage<UserScreenActivation>();
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:8,代码来源:ScreenCollection.cs

示例3: ScreenCollection

        public ScreenCollection(TabControl tabs, IEventAggregator events)
        {
            _tabs = tabs;
            _tabItems.OnMissing = screen => new StoryTellerTabItem(screen, events);

            // Sends a message when the user select a different tab on the screen
            _tabs.SelectionChanged += (s, c) => events.SendMessage<UserScreenActivation>();

            // Hack.  Sigh.
            events.AddListener(new RenameTestHandler(new ScreenFinder(this), this));
        }
开发者ID:wbinford,项目名称:storyteller,代码行数:11,代码来源:ScreenCollection.cs

示例4: StoryTellerTabItem

        public StoryTellerTabItem(IScreen screen, IEventAggregator events)
        {
            Func<Action<IScreenConductor>, Action> sendMessage = a => () => events.SendMessage(a);

            Header = new StackPanel().Horizontal()
                .AddText(screen.Title, x => _label = x)
                .IconButton(Icon.Close, sendMessage(s => s.Close(screen)), b => b.SmallerImages());

            Content = new DockPanel().With(screen.View);
            Tag = screen;

            // Sets up a context menu for each tab in the screen that can capture "Close"
            // messages
            ContextMenu = new ContextMenu().Configure(o =>
            {
                o.AddItem("Close", sendMessage(s => s.Close(screen)));
                o.AddItem("Close All But This", sendMessage(s => s.CloseAllBut(screen)));
                o.AddItem("Close All", sendMessage(s => s.CloseAll()));
            });
        }
开发者ID:wbinford,项目名称:storyteller,代码行数:20,代码来源:ScreenCollection.cs


注:本文中的IEventAggregator.SendMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。