public void SetState(RendererStateBase newState) { this.widgetsRoot.Children.Clear(); foreach (var w in newState.Widgets) { this.widgetsRoot.Children.Add(w); } this.currentState = newState; this.currentState.draw = this.draw; }