private void Header_Checked(object sender, RoutedEventArgs e) { foreach (UIElement element in Levels.Children) { if (element is LevelUserControl) { LevelUserControl level = element as LevelUserControl; level.Header.IsEnabled = true; } } }
/// <summary> /// Insert a level radio button within the levels stack panel /// </summary> /// <param name="header">header of level</param> /// <param name="details">details of level</param> public void AddLevel(Level level) { LevelUserControl levelController = new LevelUserControl(level.Header, level.Details, Header.Content.ToString()); //insert seperator between pairs of levels if (Levels.Children.Count > 0) { Separator sep = new Separator(); sep.Height = 5; Levels.Children.Add(sep); } Levels.Children.Add(levelController); }