|
|
@ -9,11 +9,11 @@ namespace Avalonia.Styling.Activators |
|
|
/// <remarks>
|
|
|
/// <remarks>
|
|
|
/// A style activator is very similar to an `IObservable{bool}` but is optimized for the
|
|
|
/// A style activator is very similar to an `IObservable{bool}` but is optimized for the
|
|
|
/// particular use-case of activating a style according to a selector. It differs from
|
|
|
/// particular use-case of activating a style according to a selector. It differs from
|
|
|
/// an observable in two major ways:
|
|
|
/// an observable in three major ways:
|
|
|
///
|
|
|
///
|
|
|
/// - Can only have a single subscription
|
|
|
/// - Can only have a single subscription
|
|
|
/// - The subscription can have a tag associated with it, allowing a subscriber to index
|
|
|
/// - The activation state can be re-evaluated at any time by calling <see cref="GetIsActive"/>
|
|
|
/// into a list of subscriptions without having to allocate additional objects.
|
|
|
/// - No error or completion messages
|
|
|
/// </remarks>
|
|
|
/// </remarks>
|
|
|
[Unstable] |
|
|
[Unstable] |
|
|
public interface IStyleActivator : IDisposable |
|
|
public interface IStyleActivator : IDisposable |
|
|
@ -38,11 +38,10 @@ namespace Avalonia.Styling.Activators |
|
|
/// Subscribes to the activator.
|
|
|
/// Subscribes to the activator.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="sink">The listener.</param>
|
|
|
/// <param name="sink">The listener.</param>
|
|
|
/// <param name="tag">An optional tag.</param>
|
|
|
|
|
|
/// <remarks>
|
|
|
/// <remarks>
|
|
|
/// This method should not call <see cref="IStyleActivatorSink.OnNext(bool, int)"/>.
|
|
|
/// This method should not call <see cref="IStyleActivatorSink.OnNext(bool, int)"/>.
|
|
|
/// </remarks>
|
|
|
/// </remarks>
|
|
|
void Subscribe(IStyleActivatorSink sink, int tag = 0); |
|
|
void Subscribe(IStyleActivatorSink sink); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Unsubscribes from the activator.
|
|
|
/// Unsubscribes from the activator.
|
|
|
|