Browse Source

Make Decorator.Child an IControl.

pull/472/head
Steven Kirk 11 years ago
parent
commit
9044d586a5
  1. 9
      src/Perspex.Controls/Decorator.cs

9
src/Perspex.Controls/Decorator.cs

@ -13,8 +13,8 @@ namespace Perspex.Controls
/// <summary>
/// Defines the <see cref="Child"/> property.
/// </summary>
public static readonly StyledProperty<Control> ChildProperty =
PerspexProperty.Register<Decorator, Control>(nameof(Child));
public static readonly StyledProperty<IControl> ChildProperty =
PerspexProperty.Register<Decorator, IControl>(nameof(Child));
/// <summary>
/// Defines the <see cref="Padding"/> property.
@ -35,7 +35,7 @@ namespace Perspex.Controls
/// Gets or sets the decorated control.
/// </summary>
[Content]
public Control Child
public IControl Child
{
get { return GetValue(ChildProperty); }
set { SetValue(ChildProperty, value); }
@ -70,8 +70,7 @@ namespace Perspex.Controls
/// <inheritdoc/>
protected override Size ArrangeOverride(Size finalSize)
{
Control content = Child;
content?.Arrange(new Rect(finalSize).Deflate(Padding));
Child?.Arrange(new Rect(finalSize).Deflate(Padding));
return finalSize;
}

Loading…
Cancel
Save