Hi. i guess you have a control that has some property like DataGrid.ItemsSource and you populate it in code behind. i suppose we are a DataGrid and its name is "MainDataGrid".your Xaml is like this(for example):
<DataGrid x:Name="MainDataGrid" Loaded="MainDataGrid_Loaded">
</DataGrid>
and in your codeBehind you must write:
using System.ComponentModel;
then:
private void MainDataGrid_Loaded(object sender, RoutedEventArgs e)
{
if (!DesignerProperties.GetIsInDesignMode(this))
{
MainDataGrid.ItemsSource=//a method that return a list or a List<yourSpecifiedType>
}
}
maybe your ItemsSource is filled by null.
good luck