protected override void OnParentChanged(EventArgs e)
{
if (this.Parent == null)
{
this.TaskPane = null;
}
else if (this.Parent is TaskPane)
{
this.TaskPane = (TaskPane) this.Parent;
this.Location = this.TaskPane.CalcExpandoLocation(this);
}
base.OnParentChanged(e);
}