public static void Copy(FieldValue source, ref FieldValue target)
		{
			if (source != null && target != null)
			{
				target.Id = source.Id;
				target.Vaalue = source.Vaalue;
				target.IsCustom = source.IsCustom;
				// target.IsJustAdded = source.IsJustAdded; // we don't want this!
			}
		}
		public static void Copy(SwitchableObservableCollection<FieldValue> source, SwitchableObservableCollection<FieldValue> target)
		{
			if (source != null && target != null)
			{
				target.IsObserving = false;
				foreach (var sourceRecord in source)
				{
					var targetRecord = new FieldValue();
					Copy(sourceRecord, ref targetRecord);
					target.Add(targetRecord);
				}
				target.IsObserving = true;
			}
		}
		public async Task<bool> RemovePossibleValueFromCurrentFieldDescriptionAsync(FieldValue fldVal)
		{
			var mbc = _briefcase?.MetaBriefcase;
			if (mbc == null) return false;

			return await RunFunctionIfOpenAsyncTB(() => mbc.RemovePossibleValueFromCurrentFieldDescriptionAsync(fldVal)).ConfigureAwait(false);
		}
		internal bool RemovePossibleValue(FieldValue removedValue)
		{
			if (removedValue != null) return _possibleValues.Remove(removedValue);
			else return false;
		}
		internal bool AddPossibleValue(FieldValue newValue)
		{
			if (!string.IsNullOrWhiteSpace(newValue?.Vaalue) && !_possibleValues.Any(pv => pv.Vaalue == newValue.Vaalue || pv.Id == newValue.Id))
			{
				int cntBefore = _possibleValues.Count;
				_possibleValues.Add(newValue);
				return _possibleValues.Count > cntBefore;
			}
			return false;
		}
		public Task<bool> RemovePossibleValueFromCurrentFieldDescriptionAsync(FieldValue fldVal)
		{
			return RunFunctionIfOpenAsyncTB(async delegate
			{
				var currFldDsc = _currentFieldDescription;
				if (fldVal == null || currFldDsc == null || (!fldVal.IsJustAdded && !IsElevated)) return false;

				bool isRemoved = false;
				await RunInUiThreadAsync(() => isRemoved = currFldDsc.RemovePossibleValue(fldVal)).ConfigureAwait(false);
				await _rubbishBin.AddPossibleValueAsync(currFldDsc, fldVal).ConfigureAwait(false);
				return isRemoved;
			});
		}
		public Task<bool> AddNewPossibleValueToCurrentFieldDescriptionAsync()
		{
			return RunFunctionIfOpenAsyncTB(async delegate
			{
				if (_currentFieldDescription == null) return false;

				string name = RuntimeData.GetText("NewFieldValue");
				var newFldVal = new FieldValue(name, true, true);

				bool isAdded = false;
				await RunInUiThreadAsync(() => isAdded = _currentFieldDescription.AddPossibleValue(newFldVal)).ConfigureAwait(false);
				return isAdded;
			});
		}
		private bool CopyXMLPropertiesFrom(MetaBriefcaseRubbishBin source)
		{
			if (source == null) return false;

			Category.Copy(source._deletedCategories, ref _deletedCategories, _mbc.FieldDescriptions);

			_deletedFieldDescriptions.Clear();
			if (source._deletedFieldDescriptions != null)
			{
				foreach (var srcLine in source._deletedFieldDescriptions)
				{
					var fldDsc = new FieldDescription();
					FieldDescription.Copy(srcLine.Item2, ref fldDsc);
					_deletedFieldDescriptions.Add(Tuple.Create(srcLine.Item1, fldDsc));
				}
			}

			_deletedFieldValues.Clear();
			if (source._deletedFieldValues != null)
			{
				foreach (var srcLine in source._deletedFieldValues)
				{
					var fldDsc = new FieldDescription();
					FieldDescription.Copy(srcLine.Item1, ref fldDsc);
					var fldVal = new FieldValue();
					FieldValue.Copy(srcLine.Item2, ref fldVal);
					_deletedFieldValues.Add(Tuple.Create(fldDsc, fldVal));
				}
			}

			return true;
		}
		internal Task AddPossibleValueAsync(FieldDescription fieldDescription, FieldValue fieldValue)
		{
			if (fieldDescription == null || fieldValue == null) return Task.CompletedTask;
			return RunFunctionIfOpenAsyncA(() =>
			{
				_deletedFieldValues.RemoveAll(pv => pv.Item1.Id == fieldDescription.Id && pv.Item2.Vaalue == fieldValue.Vaalue);
				_deletedFieldValues.Add(Tuple.Create(fieldDescription, fieldValue));
			});
		}