1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 06:27:18 +08:00

Consume BindCollectionChanged

This commit is contained in:
Dean Herbert 2020-09-11 22:53:03 +09:00
parent cb14d847de
commit 001cd1194c

View File

@ -256,13 +256,13 @@ namespace osu.Game.Screens.Edit
changeHandler.CanRedo.BindValueChanged(v => redoMenuItem.Action.Disabled = !v.NewValue, true);
// todo: BindCollectionChanged
editorBeatmap.SelectedHitObjects.CollectionChanged += (_, __) =>
editorBeatmap.SelectedHitObjects.BindCollectionChanged((_, __) =>
{
var hasObjects = editorBeatmap.SelectedHitObjects.Count > 0;
cutMenuItem.Action.Disabled = !hasObjects;
copyMenuItem.Action.Disabled = !hasObjects;
};
}, true);
clipboard.BindValueChanged(content => pasteMenuItem.Action.Disabled = string.IsNullOrEmpty(content.NewValue));