//everything that is added with menuChange will triggure this method private void Menu_OnMenuChange(object sender, EventArgs e) { XMLManager<Menu> xmlManager = new XMLManager<Menu>(); menu.UnloadContent(); menu = xmlManager.Load(menu.Id);//we r loading brand new menu menu.LoadContent(); menu.OnMenuChange += Menu_OnMenuChange; menu.Transition(0.0f); foreach (MenuItem item in menu.Items) { item.Image.StoreEffects(); item.Image.ActivateEffect("FadeEffect"); } }
public ManuManager() { menu = new Menu(); menu.OnMenuChange += Menu_OnMenuChange;//we are adding this method to the event, like delegat }