Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Maupin <ermaup@microsoft.com>2019-02-19 23:35:15 +0300
committerEric Maupin <ermaup@microsoft.com>2019-03-13 01:32:59 +0300
commitf21098848ccae7890012106d51f70ef8476744a4 (patch)
tree9e4683fec081d1f39faaa329ad98ce900e846567 /Xamarin.PropertyEditing
parente61f6717dd084a4dc88feedf0a96f0ac6fabf6fe (diff)
[mac] Collection property editor
Diffstat (limited to 'Xamarin.PropertyEditing')
-rw-r--r--Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs b/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs
index c833a6f..8f1bdd0 100644
--- a/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs
+++ b/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs
@@ -188,6 +188,12 @@ namespace Xamarin.PropertyEditing.ViewModels
get;
}
+ public void MoveTarget (int index, int target)
+ {
+ this.collectionView.Move (index, target);
+ ReIndex ();
+ }
+
protected override async Task UpdateCurrentValueAsync ()
{
await base.UpdateCurrentValueAsync ();
@@ -372,7 +378,12 @@ namespace Xamarin.PropertyEditing.ViewModels
var args = new TypeRequestedEventArgs();
TypeRequested?.Invoke (this, args);
- ITypeInfo st = await args.SelectedType;
+ ITypeInfo st = null;
+ try {
+ st = await args.SelectedType;
+ } catch (OperationCanceledException) {
+ }
+
if (st != null) {
if (!this.suggestedTypes.Contains (st))
this.suggestedTypes.Insert (0, st);
@@ -414,9 +425,7 @@ namespace Xamarin.PropertyEditing.ViewModels
private void MoveTarget (bool up)
{
int index = this.collectionView.IndexOf (SelectedTarget);
- this.collectionView.Move (index, index + ((up) ? -1 : 1));
-
- ReIndex();
+ MoveTarget (index, index + ((up) ? -1 : 1));
}
private bool CanAddTarget ()