Browse Source

fix bug introduced in dropdownitem the clears :selected psuedo class

from any control that has IsFocusedProperty.
pull/1648/head
Dan Walmsley 8 years ago
parent
commit
15bb5cf88f
  1. 13
      src/Avalonia.Controls/DropDownItem.cs

13
src/Avalonia.Controls/DropDownItem.cs

@ -22,14 +22,13 @@ namespace Avalonia.Controls
static DropDownItem()
{
FocusableProperty.OverrideDefaultValue<DropDownItem>(true);
IsFocusedProperty.Changed.Subscribe(x =>
{
var sender = x.Sender as IControl;
}
if (sender != null)
{
((IPseudoClasses)sender.Classes).Set(":selected", (bool)x.NewValue);
}
public DropDownItem()
{
this.GetObservable(DropDownItem.IsFocusedProperty).Subscribe(focused =>
{
PseudoClasses.Set(":selected", focused);
});
}

Loading…
Cancel
Save