public AddSoilViewModel(INavigation navigation, string selectedID)
        {
            _navigation     = navigation;
            _soil           = new SOIL();
            _soil.SOILID    = selectedID;
            _soilRepository = new SoilRepository();
            _fk             = selectedID;
            _soil.DEPTHFROM = 0;
            _soil.DEPTHTO   = 0;

            AddCommand            = new Command(async() => await Update());
            DeleteCommand         = new Command(async() => await Delete());
            ListPorePattern       = PickerService.PorePatternItems().ToList();
            SoilHorizonCommand    = new Command(async() => await ShowSoilHorizon());
            SoilStructureCommand  = new Command(async() => await ShowSoilStructure());
            ColourCommand         = new Command(async() => await ShowColour());
            MottleColourCommand   = new Command(async() => await ShowMottleColour());
            GleyColourCommand     = new Command(async() => await ShowGleyColour());
            TextureCommand        = new Command(async() => await ShowTexture());
            IsChanged             = false;
            OnAppearingCommand    = new Command(() => OnAppearing());
            OnDisappearingCommand = new Command(() => OnDisappearing());
            if (util.AllowAutoNumber)
            {
                _soil.HORIZONNUMBER = _soilRepository.GetNextNumber(_fk);
            }
        }
 public SoilListViewModel(INavigation navigation, string fk)
 {
     _navigation         = navigation;
     _soilRepository     = new SoilRepository();
     _fk                 = fk;
     AddCommand          = new Command(async() => await ShowAdd(_fk));
     DeleteAllCommand    = new Command(async() => await DeleteAll());
     ShowFilteredCommand = new Command <SOIL>(async(x) => await ShowSoil(x));
     FetchSoil();
 }
 public AddSoilViewModel(INavigation navigation, string selectedID)
 {
     _navigation          = navigation;
     _soil                = new SOIL();
     _soil.SOILID         = selectedID;
     _soilRepository      = new SoilRepository();
     _fk                  = selectedID;
     AddCommand           = new Command(async() => await Update());
     DeleteCommand        = new Command(async() => await Delete());
     ListPorePattern      = PickerService.PorePatternItems().ToList();
     SoilHorizonCommand   = new Command(async() => await ShowSoilHorizon());
     SoilStructureCommand = new Command(async() => await ShowSoilStructure());
     ColourCommand        = new Command(async() => await ShowColour());
     MottleColourCommand  = new Command(async() => await ShowMottleColour());
 }
 public SoilDetailsViewModel(INavigation navigation, string selectedID)
 {
     _navigation     = navigation;
     _soil           = new SOIL();
     _soil.SOILID    = selectedID;
     _soilRepository = new SoilRepository();
     //_fk = selectedID;
     _selectedid          = selectedID;
     UpdateCommand        = new Command(async() => await Update());
     DeleteCommand        = new Command(async() => await Delete());
     ListPorePattern      = PickerService.PorePatternItems().ToList();
     SoilHorizonCommand   = new Command(async() => await ShowSoilHorizon());
     SoilStructureCommand = new Command(async() => await ShowSoilStructure());
     ColourCommand        = new Command(async() => await ShowColour());
     MottleColourCommand  = new Command(async() => await ShowMottleColour());
     GleyColourCommand    = new Command(async() => await ShowGleyColour());
     TextureCommand       = new Command(async() => await ShowTexture());
     ImageCommand         = new Command(async() => await ShowImage());
     // Get the soil
     FetchDetails(_selectedid);
     IsChanged             = false;
     OnAppearingCommand    = new Command(() => OnAppearing());
     OnDisappearingCommand = new Command(() => OnDisappearing());
 }