(!) : . MonoTouch MonoDroid
, , , BestSellers: MvvmCross BestSellers
BestSellers 2 , , , MvvmCross:
- BaseViewModel ViewModel,
- " " ViewModels UI, UIAlertViews, Toasts / MessageBoxes.
, BestSellers:
ViewModel - . , :
public CategoryListViewModel()
{
AsyncLoad();
}
private void AsyncLoad()
{
GeneralAsyncLoad(URL_CATEGORIES, ProcessResult);
}
GeneralAsyncLoad BaseViewModel:
protected void GeneralAsyncLoad(string url, Action<Stream> responseStreamHandler)
{
try
{
IsLoading = true;
var request = WebRequest.Create(url);
request.BeginGetResponse((result) => GeneralProcessResponse(request, result, responseStreamHandler), null);
}
catch (ThreadAbortException)
{
throw;
}
catch (Exception exception)
{
IsLoading = false;
ReportError("Sorry - problem seen " + exception.Message);
}
}
ReportError - a IErrorReporter.
- . ErrorApplicationObject App.cs
, IErrorSource IErrorReporter.
- :
, , - , - ViewModel BaseViewModel.