// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using System.Collections.Generic; namespace osu.Framework.Bindables { public interface IBindableDictionary : IReadOnlyDictionary, ICanBeDisabled, IHasDefaultValue, IUnbindable, IHasDescription where TKey : notnull { /// /// An event which is raised when this changes. /// event NotifyDictionaryChangedEventHandler? CollectionChanged; /// /// Binds self to another bindable such that we receive any values and value limitations of the bindable we bind width. /// /// The foreign bindable. This should always be the most permanent end of the bind (ie. a ConfigManager) void BindTo(IBindableDictionary them); /// /// Bind an action to with the option of running the bound action once immediately /// with an event for the entire contents of this . /// /// The action to perform when this changes. /// Whether the action provided in should be run once immediately. void BindCollectionChanged(NotifyDictionaryChangedEventHandler onChange, bool runOnceImmediately = false); /// /// An alias of provided for use in object initializer scenarios. /// Passes the provided value as the foreign (more permanent) bindable. /// sealed IBindableDictionary BindTarget { set => BindTo(value); } /// IBindableDictionary GetBoundCopy(); } }