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>2018-12-08 00:07:07 +0300
committerEric Maupin <ermaup@microsoft.com>2018-12-08 01:04:22 +0300
commitf33471d0c3ef4fedd4dc1a2698a8f48bf7bafdc3 (patch)
tree09e57c49c7c7289e1af8488abb9f9696164ad706 /Xamarin.PropertyEditing.Windows
parent701fe5ee0b619bde33d11f1230496bc925fdd0a1 (diff)
[Core] Use a Task result for type request
This allows for a request to be answered in the future, preventing the implementing UI to have to block for a response during the event request. Primarily used to support Mac as it uses popovers rather than whole windows.
Diffstat (limited to 'Xamarin.PropertyEditing.Windows')
-rw-r--r--Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml.cs3
-rw-r--r--Xamarin.PropertyEditing.Windows/ObjectEditorControl.cs3
2 files changed, 4 insertions, 2 deletions
diff --git a/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml.cs b/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml.cs
index 097eab7..cc2ccd7 100644
--- a/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml.cs
+++ b/Xamarin.PropertyEditing.Windows/CollectionEditorWindow.xaml.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Threading.Tasks;
using System.Windows;
using Xamarin.PropertyEditing.ViewModels;
@@ -39,7 +40,7 @@ namespace Xamarin.PropertyEditing.Windows
private void OnTypeRequested (object sender, TypeRequestedEventArgs args)
{
- args.SelectedType = TypeSelectorWindow.RequestType (this, ((CollectionPropertyViewModel)DataContext).AssignableTypes);
+ args.SelectedType = Task.FromResult (TypeSelectorWindow.RequestType (this, ((CollectionPropertyViewModel)DataContext).AssignableTypes));
}
private void OnOkClick (object sender, RoutedEventArgs e)
diff --git a/Xamarin.PropertyEditing.Windows/ObjectEditorControl.cs b/Xamarin.PropertyEditing.Windows/ObjectEditorControl.cs
index eec3c44..c9817d2 100644
--- a/Xamarin.PropertyEditing.Windows/ObjectEditorControl.cs
+++ b/Xamarin.PropertyEditing.Windows/ObjectEditorControl.cs
@@ -1,3 +1,4 @@
+using System.Threading.Tasks;
using System.Windows;
using Xamarin.PropertyEditing.ViewModels;
@@ -35,7 +36,7 @@ namespace Xamarin.PropertyEditing.Windows
var panel = this.FindPropertiesHost ();
ITypeInfo type = TypeSelectorWindow.RequestType (panel, vsender.AssignableTypes);
- e.SelectedType = type;
+ e.SelectedType = Task.FromResult (type);
}
}
}