public void LoadCropById(CropModel cm)
        {
            GetFieldByIdCompleted fieldDataHandler = new GetFieldByIdCompleted(LoadFieldById);
            FieldModel fieldModel = new FieldModel();
            fieldModel.GetFieldById(new Action<FieldModel>(fieldDataHandler), cm.FieldId);

            byte[] avatarImageByte = cm.AvatarImage;

            if (avatarImageByte != null)
            {
                MemoryStream ms = new MemoryStream(avatarImageByte);
                BitmapImage avatar = new BitmapImage();
                avatar.SetSource(ms);
                AvatarImg.Source = avatar;
            }

            NameTxt.Text = cm.Name;
            TypeTxt.Text = cm.Type;
            TimeOfPlantingTxt.Text = cm.TimeOfPlanting.ToString("yyyy-MM-dd");
            AreaCoverageTxt.Text = cm.CoverageValue.ToString();
            WateringTxt.Text = cm.WateringFrequency + " X " + cm.WateringPeriod;
            HillingTxt.Text = cm.HillingTime.ToString("yyyy-MM-dd");
            HarvestingTxt.Text = cm.HarvestTime.ToString("yyyy-MM-dd");
            FertilizingTimeTxt.Text = cm.FertilizingTime.ToString("yyyy-MM-dd");
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            string fieldIdValue = NavigationContext.QueryString["parameter"];
            int fieldId = Int16.Parse(fieldIdValue);

            // Load Field data
            GetFieldByIdCompleted handler = new GetFieldByIdCompleted(LoadFieldById);
            FieldModel fieldModel = new FieldModel();
            fieldModel.GetFieldById(new Action<FieldModel>(handler), fieldId);

            // Load Maps ids
            GetMapidsCompleted mapIdsHandler = new GetMapidsCompleted(LoadMapIds);
            MapFieldModel mfModel = new MapFieldModel();
            mfModel.GetMapIds(new Action<List<int>>(mapIdsHandler), fieldId);
        }