xamarin - Where to put heavy init operations in MvvmCross -


in mvvmcross viewmodel, init method used screen initialization. however, screen not drawn until init completed. have heavy operations (db searching). ideally draw screen progress bar, , run initialization methods, , update screen. put these operations in mvvmcross viewmodel?

i heavy stuff in service. in service either:

  • make method triggers done event can listen in viewmodel , there populate properties data.

or

  • make async method await on background thread , when returns populate properties.

while service runs , fetches data, display else on screen, while data loads. cached data or progress bar or else.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -