1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Wire dropdowns back to bindables

This commit is contained in:
Drew DeVault 2016-12-05 09:24:54 -05:00
parent bf33bded24
commit bf7ec397dd

View File

@ -49,6 +49,18 @@ namespace osu.Game.Overlays.Options
dropdown.SelectedValue = bindable.Value;
}
void Dropdown_ValueChanged(object sender, EventArgs e)
{
bindable.Value = dropdown.SelectedValue;
}
protected override void Dispose(bool isDisposing)
{
bindable.ValueChanged -= Bindable_ValueChanged;
dropdown.ValueChanged -= Dropdown_ValueChanged;
base.Dispose(isDisposing);
}
public DropdownOption()
{
if (!typeof(T).IsEnum)
@ -69,6 +81,7 @@ namespace osu.Game.Overlays.Options
Items = items.Select(item => new StyledDropDownMenuItem<T>(item.Item1, item.Item2))
}
};
dropdown.ValueChanged += Dropdown_ValueChanged;
}
private class StyledDropDownMenu<U> : DropDownMenu<U>