All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

InfiniteAsyncSource.GetTotalSummariesCommand Property

Gets or sets a command that allows you to get total summaries.

Namespace: DevExpress.Xpf.Data

Assembly: DevExpress.Xpf.Core.v21.1.dll

Declaration

public ICommand<GetSummariesAsyncArgs> GetTotalSummariesCommand { get; set; }

Property Value

Type Description
DevExpress.Mvvm.ICommand<GetSummariesAsyncArgs>

A command that allows you to get total summaries.

Remarks

Bind a command to the GetTotalSummariesCommand property to maintain a clean MVVM pattern. The command works like a InfiniteAsyncSource.GetTotalSummaries event handler and allows you to process summaries in a ViewModel.

Follow the steps below to process total summaries in the ViewModel:

  1. Create a task that uses the Issues Service‘s GetSummariesAsync method to get summaries from a data source.
  2. Use the Summaries property to get the GridControl‘s summary items.
  3. Create a GetTotalSummaries command.
  4. Specify the Result property to return summaries that correspond to the GridControl‘s summary items.
  5. Bind the GetTotalSummaries command to the InfiniteAsyncSource.GetTotalSummariesCommand / PagedAsyncSource.GetTotalSummariesCommand property.
[Command]
public void GetTotalSummaries(GetSummariesAsyncArgs args) {
    args.Result = GetTotalSummariesAsync(args);
}
static async Task<object[]> GetTotalSummariesAsync(GetSummariesAsyncArgs args) {
    var summaryValues = await IssuesService.GetSummariesAsync((IssueFilter)args.Filter);
    return args.Summaries.Select(x => {
        if(x.SummaryType == SummaryType.Count)
            return (object)summaryValues.Count;
        if(x.SummaryType == SummaryType.Max && x.PropertyName == "Created")
            return summaryValues.LastCreated;
        throw new InvalidOperationException();
    }).ToArray();
}

For information on how to display total summaries, refer to the following help topic: Display Summaries.

See Also