protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (!this.DesignMode)
{
Desktop existingInstance = Desktop.GetCurrent(this.Page);
if (existingInstance != null && !DesignMode)
{
throw new InvalidOperationException("Only one desktop is allowed");
}
this.Page.Items[typeof(Desktop)] = this;
if (this.content != null)
{
this.content.InstantiateIn(this);
}
}
}