|
@@ -97,8 +97,8 @@ namespace Avalonia.Controls
|
|
private bool _isAttachedToLogicalTree;
|
|
private bool _isAttachedToLogicalTree;
|
|
private IAvaloniaList<ILogical> _logicalChildren;
|
|
private IAvaloniaList<ILogical> _logicalChildren;
|
|
private INameScope _nameScope;
|
|
private INameScope _nameScope;
|
|
- private Styles _styles;
|
|
|
|
private bool _styled;
|
|
private bool _styled;
|
|
|
|
+ private Styles _styles;
|
|
private Subject<IStyleable> _styleDetach = new Subject<IStyleable>();
|
|
private Subject<IStyleable> _styleDetach = new Subject<IStyleable>();
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -259,18 +259,14 @@ namespace Avalonia.Controls
|
|
public bool IsInitialized { get; private set; }
|
|
public bool IsInitialized { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// Gets or sets the styles for the control.
|
|
|
|
|
|
+ /// Gets the styles for the control.
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <remarks>
|
|
/// Styles for the entire application are added to the Application.Styles collection, but
|
|
/// Styles for the entire application are added to the Application.Styles collection, but
|
|
/// each control may in addition define its own styles which are applied to the control
|
|
/// each control may in addition define its own styles which are applied to the control
|
|
/// itself and its children.
|
|
/// itself and its children.
|
|
/// </remarks>
|
|
/// </remarks>
|
|
- public Styles Styles
|
|
|
|
- {
|
|
|
|
- get { return _styles ?? (_styles = new Styles()); }
|
|
|
|
- set { _styles = value; }
|
|
|
|
- }
|
|
|
|
|
|
+ public Styles Styles => _styles ?? (_styles = new Styles());
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets the control's logical parent.
|
|
/// Gets the control's logical parent.
|
|
@@ -336,6 +332,9 @@ namespace Avalonia.Controls
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
IObservable<IStyleable> IStyleable.StyleDetach => _styleDetach;
|
|
IObservable<IStyleable> IStyleable.StyleDetach => _styleDetach;
|
|
|
|
|
|
|
|
+ /// <inheritdoc/>
|
|
|
|
+ bool IStyleHost.IsStylesInitialized => _styles != null;
|
|
|
|
+
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
IStyleHost IStyleHost.StylingParent => (IStyleHost)InheritanceParent;
|
|
IStyleHost IStyleHost.StylingParent => (IStyleHost)InheritanceParent;
|
|
|
|
|