mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Consume BindCollectionChanged
This commit is contained in:
parent
cb14d847de
commit
001cd1194c
@ -256,13 +256,13 @@ namespace osu.Game.Screens.Edit
|
|||||||
changeHandler.CanRedo.BindValueChanged(v => redoMenuItem.Action.Disabled = !v.NewValue, true);
|
changeHandler.CanRedo.BindValueChanged(v => redoMenuItem.Action.Disabled = !v.NewValue, true);
|
||||||
|
|
||||||
// todo: BindCollectionChanged
|
// todo: BindCollectionChanged
|
||||||
editorBeatmap.SelectedHitObjects.CollectionChanged += (_, __) =>
|
editorBeatmap.SelectedHitObjects.BindCollectionChanged((_, __) =>
|
||||||
{
|
{
|
||||||
var hasObjects = editorBeatmap.SelectedHitObjects.Count > 0;
|
var hasObjects = editorBeatmap.SelectedHitObjects.Count > 0;
|
||||||
|
|
||||||
cutMenuItem.Action.Disabled = !hasObjects;
|
cutMenuItem.Action.Disabled = !hasObjects;
|
||||||
copyMenuItem.Action.Disabled = !hasObjects;
|
copyMenuItem.Action.Disabled = !hasObjects;
|
||||||
};
|
}, true);
|
||||||
|
|
||||||
clipboard.BindValueChanged(content => pasteMenuItem.Action.Disabled = string.IsNullOrEmpty(content.NewValue));
|
clipboard.BindValueChanged(content => pasteMenuItem.Action.Disabled = string.IsNullOrEmpty(content.NewValue));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user