Beispiel #1
0
        private void Initialize()
        {
            CarModel = new CarModel();
            RefreshFuelTypeList();
            RefreshBrandModelList();
            RegisterCommands();

            if (AvailableBrands != null && AvailableBrands.Count > 0)
            {
                SelectedBrand = AvailableBrands.First();
                RefreshCarModelList();
            }

            if (AvailableCarModels != null && AvailableCarModels.Count > 0)
            {
                SelectedModelType = AvailableCarModels.First();
            }

            if (AvailableFuelTypes != null && AvailableFuelTypes.Count > 0)
            {
                SelectedFuelType = AvailableFuelTypes.First();
            }
            IsActive = true;
            _eventAggregator.GetEvent <ObjectEvent>().Subscribe(HandleObjectEvent);
        }
 /// <summary>
 ///  Is executed by trigger the RemoveBrand Button. Removes the Brand from Database
 /// </summary>
 public void RemoveModelType()
 {
     SqliteDataAccess.RemoveModelTypeFromDatabase(SelectedModelType);
     SelectedBrand      = AvailableBrands.First();
     AvailableCarModels = new ObservableCollection <ModelTypeModel>(SqliteDataAccess.ModelsFromBrands(SelectedBrand.Id));
     LogHelper.WriteToLog("ModelType deleted", LogState.Debug);
 }