public bool Decorate() { if (Decorator != null) { Log.Warn("Decorate() called on window, but it is already decorated."); return(false); } Decorator = WindowDecorator.Create(this); Decorator.Apply(); return(true); }
public bool Undecorate() { if (Decorator == null) { Log.Warn("Undecorate() called on window, but it is not decorated."); return(true); } if (!Decorator.IsUndoable) { Log.Warn("Undecorate() called on window, but decorator is not undoable."); return(true); } if (Decorator.Undo()) { (Decorator as IDisposable)?.Dispose(); Decorator = null; return(true); } return(false); }