This example illustrates how to define summary rows using AttachedProperty in WPF DataGrid (SfDataGrid).
WPF DataGrid (SfDataGrid) provides support to show the column summary. If the DataContext of SfDataGrid is ViewModel, you can bind SummaryColumns to a property in ViewModel using the AttachedProperty of type List.
KB article - How to define summary rows using AttachedProperty in WPF and UWP DataGrid (SfDataGrid)