[chore:] deleting from course list

This commit is contained in:
2026-03-03 08:14:24 +01:00
parent af2ad3dab7
commit df282d1164
2 changed files with 31 additions and 2 deletions

View File

@@ -45,7 +45,7 @@
</StackPanel>
</Button>
<ListBox Grid.RowSpan="2" x:Name="LbStudentsImported" SelectionChanged="LbStudentsImported_OnSelectionChanged" Margin="0,70,0,70" Background="MintCream" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></ListBox>
<ListBox Grid.RowSpan="2" x:Name="LbStudentsImported" SelectionChanged="LbStudentsImported_OnSelectionChanged" Margin="0,70,0,70" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></ListBox>
<StackPanel Grid.Column="1" Grid.Row="0" Margin="10,10,10,10" Orientation="Vertical" Spacing="10">
<Grid ColumnDefinitions="*,3*">
@@ -101,7 +101,7 @@
</StackPanel>
</TabItem.Header>
<Grid ColumnDefinitions="*,2*">
<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal">
<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Spacing="10">
<Button Margin="0,10,0,0" x:Name="BtnImportDefaultCourses" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnImportDefaultCourses_OnClick" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="Import" Width="24" Height="24" />
@@ -109,6 +109,20 @@
FontWeight="Bold" />
</StackPanel>
</Button>
<Button Margin="0,10,0,0" x:Name="BtnDeleteSinleCourse" Background="#99963434" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnDeleteSinleCourse_OnClick" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="Trash2" Width="24" Height="24" />
<Label Content="Ausgewähltes entfernen" VerticalContentAlignment="Center" FontSize="12"
FontWeight="Bold" />
</StackPanel>
</Button>
<Button Margin="0,10,0,0" x:Name="BtnClearCourseList" Background="#99963434" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnClearCourseList_OnClick" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="Trash" Width="24" Height="24" />
<Label Content="Liste leeren" VerticalContentAlignment="Center" FontSize="12"
FontWeight="Bold" />
</StackPanel>
</Button>
</StackPanel>
<ListBox Grid.Column="0" x:Name="LbSportCourses" SelectionChanged="LbSportCourses_OnSelectionChanged" Margin="0,55,0,0" />
<StackPanel Grid.Column="1" Grid.Row="0" Margin="10,10,10,10" Orientation="Vertical" Spacing="10">

View File

@@ -354,4 +354,19 @@ public partial class MainWindow : Window
LbSportCourses.SelectedIndex = curr_selected;
//} catch (Exception ex) {}
}
private void BtnClearCourseList_OnClick(object? sender, RoutedEventArgs e)
{
Settings.Instance.Sports.Clear();
RefreshCoursesList();
}
private void BtnDeleteSinleCourse_OnClick(object? sender, RoutedEventArgs e)
{
try
{
Settings.Instance.Sports.Remove(LbSportCourses.SelectedItem as Sport);
RefreshCoursesList();
} catch (Exception ex){}
}
}