我正在学习WPF和实现MVC模式。
在我的控制器类中,我注册了这样的事件。但是我找不到DataGrid行的RoutedEvent提交的问题。
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]);
}发布于 2012-03-23 14:04:09
它只包含像CommitEditCommand这样的RoutedCommands。您可以绑定到它,而不是订阅事件,并继续处理您的工作流。
虽然我想说的是,实现MVC并不能很好地堆叠WPF,因为它更像是MVVM或MVP的结构。绑定的大量使用证明了这一点。
https://stackoverflow.com/questions/9832597
复制相似问题