private void LinkState(IAppState appState, bool Link) { if (Link) { appState?.Load(); if (appState.StateKeyboardLayout != null) { keyboard?.AddRange(appState.StateKeyboardLayout); } //if (appState.GUI != null) //Myra.Graphics2D.UI.Desktop.Widgets.Add(appState.GUI); } else { appState?.Save(); if (appState.StateKeyboardLayout != null) { keyboard?.RemoveRange(appState.StateKeyboardLayout); } //if (appState.GUI != null) //Myra.Graphics2D.UI.Desktop.Widgets.Remove(appState.GUI ?? null); } }