private void DeleteAnchorButton_Click(object sender, RoutedEventArgs e) { var index = AnchorsListBox.SelectedIndex; if (index < 0) { return; } var anchor = AnchorsCollection[index]; if (!MessageBoxUtilities.Question($"Are you sure delete the anchor: {anchor.Name}?")) { return; } AnchorsCollection.Remove(anchor); CurrentScreen.Anchors.Remove(anchor); }
private void DeleteScreenButton_Click(object sender, RoutedEventArgs e) { var screen = GetSelectedScreen(); if (!MessageBoxUtilities.Question($"Are you sure delete the screen: {screen.Name}?")) { return; } ScreensCollection.Remove(screen); Info.Screens.Remove(screen); var path = Path.Combine(Settings.Default.CurrentDirectory, screen.Name); File.Delete(path); Save(); Load(Settings.Default.CurrentDirectory); }