ViewModelBase.BeginRefresh not working but DoRefresh does

ViewModelBase.BeginRefresh not working but DoRefresh does

Old forum URL: forums.lhotka.net/forums/t/8116.aspx


Kevin Fairclough posted on Tuesday, December 08, 2009

Hi All,

Its my first foray into MVVM for our prototype and I'm trying to get BeginRefresh with parameters to work, but cannot:

BeginRefresh("Get", PageStart,PageSize);

Our Get method has many signatures and is in a base class (bold below) of our actual business object.
ReadOnlyListBase>BaseROListBase>ItemList where ItemList is the type in the ViewModel, i.e. ViewModel<Itemlist>

The error returned is:
[Csla.Reflection.CallMethodException] = {"Get method call failed"}
InnerException = {"Object of type 'System.Int32' cannot be converted to type 'Our.Domain.ItemInfo'."}

ItemInfo is the child object of the ItemList

I've tried having a specific Get method in the ItemList class (GetPaged) but error is:
[System.InvalidOperationException] = {"No such factory method:GetPaged"}

DoRefresh works for everything I've tried.

Any Ideas
TIA
Kevin

RockfordLhotka replied on Tuesday, December 08, 2009

BeginRefresh() requires an async factory method following the model used in CSLA .NET for Silverlight - the last parameter of the factory method must be a callback delegate.

Kevin Fairclough replied on Tuesday, December 08, 2009

Thanks Rocky, All working nicely (for now!)

Copyright (c) Marimer LLC