private void productgd_LoadingDataSource(object sender, LoadingDataEventArgs e) { _facade.QueryGiftVoucherProductRelation(new GiftCardProductFilterVM { SysNo = RequestSysNo }, e.PageSize, e.PageIndex, e.SortField, (ret, totalCount) => { if (this._voucherProductVM.RelationProducts == null) { this._voucherProductVM.RelationProducts = new ObservableCollection <GiftVoucherProductRelationVM>(); } this._voucherProductVM.RelationProducts = ret; this.productgd.ItemsSource = ret; this.productgd.TotalCount = totalCount; }); }