To enable the binding conventions in Caliburn.Micro, you normally use the x:Name
property in your XAML. If you, instead of explicitly binding the List
property to ItemsSource
of your DataGrid
, use the name convention like this:
<DataGrid x:Name="List" Height="211" HorizontalAlignment="Left"
Margin="12,31,0,0" VerticalAlignment="Top" Width="521"
AutoGenerateColumns="False">
I believe the subsequent bindings should work as desired.
Oh, and you also need to make List
a property instead of a field:
public List<Article> List { get; private set; }
If you want to make sure that modifications to List
are properly reflected in your data grid, you should also make your List
property an IObservableCollection
with a backing field:
private IObservableCollection<Article> _list;
public IObservableCollection<Article> List {
get { return _list; }
set {
_list = value;
NotifyOfPropertyChange(() => List);
}
}