示例#1
0
 public static BicycleDataStore getInstance()
 {
     if (Instance == null)
     {
         Instance = new BicycleDataStore();
     }
     return(Instance);
 }
示例#2
0
        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);
            });
        }