Thanks Vlad.
I add three line code to file MyDataContext.cs to make page and sort work as I expected.
public class MyDataContext
{
private int _pageIndex = 0;
NorthwindServiceSoapClient _Client;
public NorthwindServiceSoapClient Client
{
get
{
if (_Client == null)
{
_Client = new NorthwindServiceSoapClient();
}
return _Client;
}
}
Client.GetCustomersCompleted += (s, args) =>
{
collection.SuspendNotifications();
collection.Clear();
collection.AddRange(args.Result.Data);
collection.ResumeNotifications();
_Data.SetIsLoading(false);
_Data.Refresh();
_Data.SetTotalItemsCount(args.Result.Count);
_Data.MoveToPage(_pageIndex);
_Data.CollectionChanged += CollectionChanged;
};
void Refresh()
{
_pageIndex = _Data.PageIndex;
Client.GetCustomersAsync(_Data.PageIndex * _Data.PageSize, _Data.PageSize,
_Data.SortDescriptors.ToDynamicLinq(),
_Data.FilterDescriptors.ToDynamicLinq(),
_Data.GroupDescriptors.ToDynamicLinq());
}