首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DataGrid RoutedEvent

DataGrid RoutedEvent
EN

Stack Overflow用户
提问于 2012-03-23 08:34:20
回答 1查看 396关注 0票数 0

我正在学习WPF和实现MVC模式。

在我的控制器类中,我注册了这样的事件。但是我找不到DataGrid行的RoutedEvent提交的问题。

代码语言:javascript
复制
EventManager.RegisterClassHandler(typeof(Control), DataGrid.SelectedEvent,
                                        (SelectionChangedEventHandler) SelectionChanged);



        //Get the full list of products by default
        GetAllProducts();
    }

    #region Event Handler

    //event handler for the selection changed
    private void SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        //Notify that the selected item has changed
        if (e.AddedItems != null && e.AddedItems.Count > 0)
            Mediator.NotifyColleagues(Messages.SelectProduct, e.AddedItems[0]);
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-03-23 14:04:09

它只包含像CommitEditCommand这样的RoutedCommands。您可以绑定到它,而不是订阅事件,并继续处理您的工作流。

虽然我想说的是,实现MVC并不能很好地堆叠WPF,因为它更像是MVVM或MVP的结构。绑定的大量使用证明了这一点。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9832597

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档