public void BuildTree(LevelInfo defaultSelection = null) { WorldTree.Items.Clear(); foreach (var worldInfo in _worldService.AllWorlds()) { WorldTree.Items.Add(BuildTreeViewItem(worldInfo)); } if (defaultSelection != null) { SetSelectedItem(defaultSelection); } }
public NewLevelWindow(LevelService levelService, WorldService worldService) { InitializeComponent(); _levelService = levelService; _worldService = worldService; WorldList.ItemsSource = _worldService.AllWorlds(); }
public MoveLevelWindow(LevelService levelService, WorldService worldService, WorldInfo hostWorld, LevelInfo parentLevel) { InitializeComponent(); _levelService = levelService; _worldService = worldService; _defaultParentLevel = parentLevel; WorldList.ItemsSource = _worldService.AllWorlds(); if (parentLevel == null) { LevelList.SelectedIndex = 0; } else { LevelList.SelectedItem = parentLevel; } if (hostWorld != null) { WorldList.SelectedItem = hostWorld; } }