I have the following model:
public class Model : INotifyPropertyChanged
{
public ObservableCollection<ViewElement> Elements { get; set; }
public ViewElement CurrentElement { get; set; }
}
And the following grid where the parent DataContext
is the above model:
<dg:XamDataGrid DataSource="{Binding Path=Elements}" />
I want to bind the CurrentElement
property to the Selected Item of the Grid, similar to how I would in a ListView
:
<ListView x:Name="playbackSteps"
ItemsSource="{Binding Path=Elements}"
SelectedItem="{Binding Path=CurrentElement}" />
How would you suggest I do this?