[chore:] delete alternative names from sport courses
This commit is contained in:
@@ -172,13 +172,18 @@
|
||||
<Grid ColumnDefinitions="*,3*">
|
||||
<Label Content="Alternativbezeichnungen"></Label>
|
||||
<StackPanel Grid.Column="1" Orientation="Vertical">
|
||||
<Grid ColumnDefinitions="*,50">
|
||||
<Grid ColumnDefinitions="*,50,50">
|
||||
<TextBox Grid.Column="0" Height="35" HorizontalAlignment="Stretch" x:Name="TbSportAlternativeName"></TextBox>
|
||||
<Button Grid.Column="1" Margin="0,10,0,0" x:Name="BtnAlternativeNameAdd" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnAlternativeNameAdd_OnClick" HorizontalContentAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<LucideIcon Kind="Plus" Width="24" Height="24" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Grid.Column="2" Margin="0,10,0,0" x:Name="BtnAlternativeNameRemove" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnAlternativeNameRemove_OnClick" HorizontalContentAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<LucideIcon Kind="Minus" Width="24" Height="24" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ListBox x:Name="LbAlternativeNames">
|
||||
|
||||
|
||||
@@ -331,6 +331,27 @@ public partial class MainWindow : Window
|
||||
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Add(TbSportAlternativeName.Text);
|
||||
LbAlternativeNames.Items.Add(TbSportAlternativeName.Text);
|
||||
TbSportAlternativeName.Text = "";
|
||||
|
||||
int curr_selected = LbSportCourses.SelectedIndex;
|
||||
RefreshCoursesList();
|
||||
LbSportCourses.SelectedIndex = curr_selected;
|
||||
} catch {}
|
||||
}
|
||||
|
||||
private void BtnAlternativeNameRemove_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
LbAlternativeNames.Items.Remove(LbAlternativeNames.SelectedItem);
|
||||
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Clear();
|
||||
foreach (string s in LbAlternativeNames.Items)
|
||||
{
|
||||
((Sport)LbSportCourses.SelectedItem).AlternativeNames.Add(s);
|
||||
}
|
||||
|
||||
int curr_selected = LbSportCourses.SelectedIndex;
|
||||
RefreshCoursesList();
|
||||
LbSportCourses.SelectedIndex = curr_selected;
|
||||
//} catch (Exception ex) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user