// add all campus which come from API and show them in the menu page public void AddButtons() { if (Application.Current.Properties.ContainsKey("map")) { map = (GMTEMap)Application.Current.Properties["map"]; } for (int i = stack.Children.Count - 1; i >= 2; i--) { stack.Children.RemoveAt(i); } var campusList = map.GetCampusList(); foreach (string name in campusList) { var click = new MenuButtons(name); stack.Children.Add(click); } }