From d9eee9fa4aac08b4127495d7633d9249601f0a4f Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sat, 16 Jan 2016 15:05:32 +0100 Subject: [PATCH] Make SelectionBoxItem a direct property. --- src/Perspex.Controls/DropDown.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Perspex.Controls/DropDown.cs b/src/Perspex.Controls/DropDown.cs index 27cf8209d4..6f69fcaeaf 100644 --- a/src/Perspex.Controls/DropDown.cs +++ b/src/Perspex.Controls/DropDown.cs @@ -34,10 +34,11 @@ namespace Perspex.Controls (o, v) => o.IsDropDownOpen = v); public static readonly PerspexProperty SelectionBoxItemProperty = - PerspexProperty.Register("SelectionBoxItem"); + PerspexProperty.RegisterDirect("SelectionBoxItem", o => o.SelectionBoxItem); private bool _isDropDownOpen; private Popup _popup; + private object _selectionBoxItem; static DropDown() { @@ -76,8 +77,8 @@ namespace Perspex.Controls protected object SelectionBoxItem { - get { return GetValue(SelectionBoxItemProperty); } - set { SetValue(SelectionBoxItemProperty, value); } + get { return _selectionBoxItem; } + set { SetAndRaise(SelectionBoxItemProperty, ref _selectionBoxItem, value); } } protected override IItemContainerGenerator CreateItemContainerGenerator()