|
|
|
@ -10,10 +10,17 @@ namespace Perspex |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Diagnostics.Contracts; |
|
|
|
using System.Linq; |
|
|
|
using Perspex.Controls; |
|
|
|
using Perspex.Media; |
|
|
|
|
|
|
|
public abstract class Visual : PerspexObject, IVisual, ILogical |
|
|
|
{ |
|
|
|
public static readonly ReadOnlyPerspexProperty<Control> ParentProperty = |
|
|
|
new ReadOnlyPerspexProperty<Control>(ParentPropertyRW); |
|
|
|
|
|
|
|
internal static readonly PerspexProperty<Control> ParentPropertyRW = |
|
|
|
PerspexProperty.Register<Control, Control>("Parent"); |
|
|
|
|
|
|
|
private ILogical logicalParent; |
|
|
|
|
|
|
|
private IVisual visualParent; |
|
|
|
@ -24,10 +31,24 @@ namespace Perspex |
|
|
|
protected set; |
|
|
|
} |
|
|
|
|
|
|
|
public Control Parent |
|
|
|
{ |
|
|
|
get { return this.GetValue(ParentPropertyRW); } |
|
|
|
protected set { this.SetValue(ParentPropertyRW, value); } |
|
|
|
} |
|
|
|
|
|
|
|
ILogical ILogical.LogicalParent |
|
|
|
{ |
|
|
|
get { return this.logicalParent; } |
|
|
|
set { this.logicalParent = value; } |
|
|
|
get |
|
|
|
{ |
|
|
|
return this.logicalParent; |
|
|
|
} |
|
|
|
|
|
|
|
set |
|
|
|
{ |
|
|
|
this.logicalParent = value; |
|
|
|
this.Parent = value as Control; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
IEnumerable<ILogical> ILogical.LogicalChildren |
|
|
|
|