I am currently working on a 2D roguelike in which all of the menuscreens and areas are inherited from : DrawableGameComponent.
When I need to swap components I usually have an "if" statement that checks in update confirming that all the criteria for the switch have been met (fadeouts and whatnot), then something like:
if ((gobackbool == true) && (Game.Components.Contains(titlecomponent) == false))
{
titlecomponent = new Title(Game);
Game.Components.Add(titlecomponent);
Game.Components.Remove(this);
}
Title is the class : DrawableGameComponent that represents my titlescreen btw, "titlecomponent" was what I called the field for Title in the current component that the code was pulled from.
All that being said, I myself am a noob and some pro here might know a better way to handle this!