i am developing a wpf application , in which when the user performs selection changed action on a combobox , selection changed event is triggered, but in the event handler when i update datagrid.itemsSource, error is shown to use a new key word to create the object, through break point i have seen that inside the event handler datagrid object itself is null, but it is not null in the MainWindow function. why is it so?
private void majorkeys_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
minordata.ItemsSource = ReadLibrary.get_minor_records(majorkeys.SelectedValue.ToString(), minorkeys.SelectedValue.ToString());
}