private void DeleteRows(object sender, DevExpress.Xpf.Grid.GridValidateRowDeletionEventArgs e)
 {
     foreach (var row in e.Rows)
     {
         IssuesService.DeleteIssueAsync((IssueData)row).Wait();
     }
 }
 void CreateUpdateRow(object sender, DevExpress.Xpf.Grid.GridRowValidationEventArgs e)
 {
     if (e.IsNewItem)
     {
         e.UpdateRowResult = IssuesService.AddNewIssueAsync((IssueData)e.Value);
     }
     else
     {
         e.UpdateRowResult = IssuesService.UpdateRowAsync((IssueData)e.Value);
     }
 }
        static async Task <FetchRowsResult> FetchRowsAsync(FetchRowsAsyncEventArgs e)
        {
            IssueSortOrder sortOrder = GetIssueSortOrder(e);
            IssueFilter    filter    = MakeIssueFilter(e.Filter);

            var take   = e.Take ?? 30;
            var issues = await IssuesService.GetIssuesAsync(
                skip : e.Skip,
                take : take,
                sortOrder : sortOrder,
                filter : filter);

            return(new FetchRowsResult(issues, hasMoreRows: issues.Length == take));
        }
        static async Task <object[]> GetTotalSummariesAsync(GetSummariesAsyncEventArgs e)
        {
            IssueFilter filter        = MakeIssueFilter(e.Filter);
            var         summaryValues = await IssuesService.GetSummariesAsync(filter);

            return(e.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());
        }