how to get datagrid's selectedItems in MVP Patterns

Apr 9, 2010 at 1:08 AM

I want to publish events in PresentationModel when the datagrid's selection is changed. So I cann't use the datagrid's selectionchanged event.                 

so, I do the following things:


 <dg:DataGrid x:Name="dgrid" ItemsSource="{Binding Path=GridData}" SelectedIndex="{Binding Path=SelectedIndex}"


        bool _isSelected = true;
        public bool IsSelected
            get { return _isSelected; }
                if (_isSelected != value)
                    _isSelected = value;
                    if (value)

                       DataGridSelectedEvent e1 = this._eventAggregator.GetEvent<DataGridSelectedEvent>();
so I can get the message in PresentationModel when the datagrid selection changed, but the selectionItems 
which received through View interface are always the last selectionItems, not the current ones.That is to say,
when the SelectedIndex changes,  I publish event before the selectionItems update. how can i do with this situation?
Question: I want publish a selectionchanged even in my PresentationModel, so I need to know when the datagrid selectionchanged, 
and get the current selectionItems in my PresentationModel. how can I do?