public static BicycleDataStore getInstance() { if (Instance == null) { Instance = new BicycleDataStore(); } return(Instance); }
public BicyclesViewModel() { Title = "Rowery"; DataStore = BicycleDataStore.getInstance(); Bicycles = new ObservableCollection <Bicycle>(); LoadBicyclesCommand = new Command(async() => await ExecuteLoadBicyclesCommand()); MessagingCenter.Subscribe <CreateBicycleViewModel, Bicycle>(this, "AddBicycle", (obj, bicycle) => { var _bicycle = bicycle as Bicycle; Bicycles.Add(_bicycle); }); }