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-09-05 00:40:50 +0300
committerEric Maupin <ermaup@microsoft.com>2018-09-05 00:40:52 +0300
commitb59a1bc8d5e37ced5d3dc408fc1a567708cfa803 (patch)
treedcadf90ccd26a5554d6d04735a34fdfcb1276920 /Xamarin.PropertyEditing.Windows
parentf4e834c60b3b3bc9780e4064b72cd9ccf9a48a74 (diff)
[Win] Enable PropertyPanel.Select()
Addresses #362 for Windows. We already do replace/reset effeciently, we just need to be sure the consumers are triggering that path.
Diffstat (limited to 'Xamarin.PropertyEditing.Windows')
-rw-r--r--Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs b/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs
index ee7fb84..90ddb10 100644
--- a/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs
+++ b/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
@@ -25,7 +26,7 @@ namespace Xamarin.PropertyEditing.Windows
Resources.MergedDictionaries.Add (new ResourceDictionary { Source = new Uri ("pack://application:,,,/Xamarin.PropertyEditing.Windows;component/Themes/Resources.xaml") });
- var selectedItems = new ObservableCollection<object> ();
+ var selectedItems = new ObservableCollectionEx<object> ();
selectedItems.CollectionChanged += OnSelectedItemsChanged;
SelectedItems = selectedItems;
}
@@ -79,6 +80,14 @@ namespace Xamarin.PropertyEditing.Windows
public static PropertyEditing.Themes.WinThemeManager ThemeManager = new PropertyEditing.Themes.WinThemeManager();
+ public void Select (IEnumerable<object> selectedItems)
+ {
+ if (selectedItems == null)
+ throw new ArgumentNullException (nameof(selectedItems));
+
+ ((ObservableCollectionEx<object>)SelectedItems).Reset (selectedItems);
+ }
+
public override void OnApplyTemplate ()
{
base.OnApplyTemplate ();