I need a way to hide the data grid control when there are no records. In the native WPF implementation it would be done like this:
DependencyObject obj = (DependencyObject)e.OriginalSource;
if (obj is DataGrid)
{
if ((obj as DataGrid).Items.Count == 0)
(obj as DataGrid).Visibility = Visibility.Collapsed;
}
however items is not a property on the WPF Data Grid Control. How can this be done? thanks