How to reload baseviewmodel

SimenesSimenes Member ✭✭
edited June 2018 in General

I have a class based on baseviewmodel thats load data from server at first time loaded, than it works only locally with a datastore. How to reload this datastore from server after the datastore already loaded?

public IDataStore CarrinhosDataStore => DependencyService.Get<IDataStore>() ?? new CarDataStore();

I want new CarDataStore(); called again, but its never called again after loaded model.

Best Answer

  • SimenesSimenes ✭✭
    Accepted Answer

    @JamesLavery
    I already have figured out the solution getting the interface method getitemsasync to reload datastore from server when the forcerefresh its setted to true. Actually i just have to reload the List inside my datastore.

Answers

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭
    What's the problem with just running the above code (apart from the declaration of the field of course) again?
  • SimenesSimenes Member ✭✭
    Accepted Answer

    @JamesLavery
    I already have figured out the solution getting the interface method getitemsasync to reload datastore from server when the forcerefresh its setted to true. Actually i just have to reload the List inside my datastore.

Sign In or Register to comment.