I have the following model:
public class Model : INotifyPropertyChanged
{
public ObservableCollection<ViewElement> Elements { get; set; }
public ViewElement CurrentElement { get; set; }
}
And the following grid, in which the parent DataContextis the above model:
<dg:XamDataGrid DataSource="{Binding Path=Elements}" />
I want to bind a property CurrentElementto a selected grid element, similar to how I would in ListView:
<ListView x:Name="playbackSteps"
ItemsSource="{Binding Path=Elements}"
SelectedItem="{Binding Path=CurrentElement}" />
How do you suggest me to do this?
source
share