I add a property TotalCount to ReadOnlyListBase for return Total Records Count(for paging)
private int? totalCount=0;
public int? TotalCount
{
get { return totalCount; }
private set
{
this.totalCount = value;
}
}
and set TotalCount in DataPortal_Fetch method, but i always get TotalCount equals 0 in my silverlight control
Please help me out!
Hi,
Csla does not support managed properties on a list and the recommended solution is to have a property on a parent object that own the list.
Read more about it in this thread: http://forums.lhotka.net/forums/p/9828/46128.aspx
If you have to do it, you can try to add the following code to your class. I have not tested that, but it should work.
protected override void OnGetState(SerializationInfo info, StateMode mode)
{
info.AddValue("totalCount", totalCount);
base.OnGetState(info, mode);
}
protected override void OnSetState(SerializationInfo info, StateMode mode)
{
totalCount = (int?)info.Values["totalCount"].Value;
base.OnSetState(info, mode);
}
Copyright (c) Marimer LLC