Dotnet 4.5 was rolled out to our organisation. Post upgrade my one WPF tool is broken (one grid doesn't display anything).
The application has a few datagrids bound to different sources. Each of the sources are identical except for the datatype.
All the other sources are working 100%.
I can see the collection contains data simply is not updating the datagrid. I have swapped the grid out for a standard ListBox and there is no change.
It seems that replacing the value with the whole collection isn't working. If I iterated and add items to an existing list then it works.
Edit 1: Why is the CollectionChanged event null on this ObservableCollection?!?
All datasource are structured as follows.
Databinding:
{Binding Sprints, Source={x:Static ViewModels:CoreViewModel.Instance}}
Property (data source):
private ObservableCollection<SprintEntity> _sprintsField;
public static ObservableCollection<SprintEntity> Sprints
{
get
{
return Instance._sprintsField;
}
set
{
if (Instance._sprintsField != value)
{
Instance._sprintsField = value;
Instance.RaisePropertyChanged("Sprints");
}
}
}
Code to get data (correctly fetches data):
public static void GetSprints(int workspaceID, Action<bool, string> callback)
{
var proxy = new NotificationServiceClient();
proxy.GetSprintsCompleted += (sender, e) =>
{
if (e.Error == null)
{
Sprints = e.Result;
callback(true, null);
}
else
{
callback(false, e.Error.Message);
throw e.Error;
}
};
proxy.GetSprintsAsync(workspaceID);
}