protected override void OnControlRemoved(ControlEventArgs e) { LockScreenWidget widget = e.Control as LockScreenWidget; if (widget != null) { widget.LockScreen = null; } base.OnControlRemoved(e); }
protected override void OnControlAdded(ControlEventArgs e) { LockScreenWidget widget = e.Control as LockScreenWidget; if (widget == null) { throw new InvalidOperationException("Only Widgets can be added to this container!"); } widget.LockScreen = this; base.OnControlAdded(e); }