csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
// -----------------------------------------------------------------------
|
|
// <copyright file="Panel.cs" company="Steven Kirk">
|
|
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|
// </copyright>
|
|
// -----------------------------------------------------------------------
|
|
|
|
namespace Perspex.Controls
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Collections.Specialized;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
/// <summary>
|
|
/// Base class for controls that can contain multiple children.
|
|
/// </summary>
|
|
public class Panel : Control, ILogical, IVisual
|
|
{
|
|
private Controls children;
|
|
|
|
private LogicalChildren<Control> logicalChildren;
|
|
|
|
public Controls Children
|
|
{
|
|
get
|
|
{
|
|
if (this.children == null)
|
|
{
|
|
this.children = new Controls();
|
|
this.logicalChildren = new LogicalChildren<Control>(this, this.children);
|
|
}
|
|
|
|
return this.children;
|
|
}
|
|
|
|
set
|
|
{
|
|
this.children = value;
|
|
|
|
if (this.logicalChildren != null)
|
|
{
|
|
this.logicalChildren.Change(this.children);
|
|
}
|
|
else
|
|
{
|
|
this.logicalChildren = new LogicalChildren<Control>(this, this.children);
|
|
}
|
|
}
|
|
}
|
|
|
|
IEnumerable<ILogical> ILogical.LogicalChildren
|
|
{
|
|
get { return this.children ?? Enumerable.Empty<ILogical>(); }
|
|
}
|
|
|
|
IEnumerable<IVisual> IVisual.VisualChildren
|
|
{
|
|
get { return this.children ?? Enumerable.Empty<IVisual>(); }
|
|
}
|
|
}
|
|
}
|
|
|