void OpenTileSetEditor(string fileName) { TileSetEditor ed = new TileSetEditor(); ed.OpenEditor(fileName); AttachNewEditor(ed); }
public void OnAddTileSetClicked(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.InitialDirectory = MainWindow.ContentDir; dlg.FileOk += MainWindow.ValidateFileName; dlg.Filter = "Tile Sets|*.tls"; Nullable<bool> result = dlg.ShowDialog(); if (result == true) { TileSetEditor tset = new TileSetEditor(); tset.Editable = false; tset.OpenEditor(dlg.FileName); tset.TileSelected += OnTileSelected; baseMap.tileSets.Add(tset.Tiles); TabItem tab = new TabItem(); tab.Header = tset.Title; tab.Content = tset; TileSets.SelectedIndex = TileSets.Items.Add(tab); OnModify(); } dlg = null; }