A cross-platform UI framework for .NET
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.
 
 
 

52 lines
1.3 KiB

// -----------------------------------------------------------------------
// <copyright file="Visual.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using Perspex.Media;
public abstract class Visual : PerspexObject
{
private Visual visualParent;
public Rect Bounds
{
get;
protected set;
}
public virtual IEnumerable<Visual> VisualChildren
{
get { return Enumerable.Empty<Visual>(); }
}
public Visual VisualParent
{
get
{
return this.visualParent;
}
set
{
if (this.visualParent != value)
{
this.visualParent = value;
this.InheritanceParent = value;
}
}
}
public virtual void Render(IDrawingContext context)
{
Contract.Requires<ArgumentNullException>(context != null);
}
}
}