// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using System.Collections.Specialized; namespace osu.Framework.Bindables { /// /// A readonly interface which can be bound to other s in order to watch for state and content changes. /// /// The type of value encapsulated by this . public interface IBindableList : IReadOnlyList, ICanBeDisabled, IHasDefaultValue, IUnbindable, IHasDescription, INotifyCollectionChanged { /// /// 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(IBindableList 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(NotifyCollectionChangedEventHandler 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 IBindableList BindTarget { set => BindTo(value); } /// IBindableList GetBoundCopy(); } }