Skip to content

Commit 3d5ff34

Browse files
committed
Removed mini cycle
1 parent a4a23e2 commit 3d5ff34

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

CSharpCodeAnalyst/Shared/DynamicDataGrid/DynamicDataGrid.xaml.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,17 @@ private static void OnSelfDescribingDataChanged(DependencyObject d, DependencyPr
8282
return;
8383
}
8484

85-
control.RebuildDataGridFromSelfDescribingData();
85+
var data = e.NewValue as IEnumerable;
86+
control.RebuildDataGridFromSelfDescribingData(data);
8687
}
8788

88-
private void RebuildDataGridFromSelfDescribingData()
89+
private void RebuildDataGridFromSelfDescribingData(IEnumerable? data)
8990
{
9091
try
9192
{
9293
ClearColumns();
9394

94-
var items = SelfDescribingData?.OfType<object>().ToArray();
95+
var items = data?.OfType<object>().ToArray();
9596
if (items is null || items.Length == 0)
9697
{
9798
ShowEmptyState(true);
@@ -105,7 +106,7 @@ private void RebuildDataGridFromSelfDescribingData()
105106
}
106107

107108
// Bind data
108-
MainDataGrid.ItemsSource = SelfDescribingData;
109+
MainDataGrid.ItemsSource = items;
109110

110111
ShowEmptyState(!items.Any());
111112
}
@@ -499,5 +500,4 @@ private void MainDataGrid_OnLoadingRow(object? sender, DataGridRowEventArgs e)
499500

500501
e.Row.ContextMenuOpening += RowOnContextMenuOpening;
501502
}
502-
503503
}

0 commit comments

Comments
 (0)