Compare commits

...

3 Commits

Author SHA1 Message Date
Elias Fierke
afbb4626a0 [feat:] implemented renaming functionality 2026-01-19 16:25:33 +01:00
Elias Fierke
ee83aca490 [feat:] included context menu for Address-SetListBox 2026-01-19 16:25:20 +01:00
Elias Fierke
b40ddfbf2e [fix:] NamingWindow.axaml had a wrong size 2026-01-19 16:17:06 +01:00
3 changed files with 42 additions and 2 deletions

View File

@@ -67,7 +67,20 @@
SelectionChanged="LstCustomerAdressSets_OnSelectionChanged"
Background="AliceBlue"
Margin="0,5,0,5"
SelectionMode="Multiple,Toggle" />
SelectionMode="Multiple,Toggle">
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem x:Name="MnIAdSetRename" Click="MnIAdSetRename_OnClick">
<MenuItem.Header>
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="Pencil" Width="12" Height="12" Size="12" />
<Label Content="Umbenennen" VerticalContentAlignment="Center" />
</StackPanel>
</MenuItem.Header>
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
<Button Grid.Row="2" HorizontalAlignment="Stretch" x:Name="BtnCustomerAddressSetImport"
Click="BtnCustomerAddressSetImport_OnClick">

View File

@@ -887,4 +887,31 @@ public partial class MainWindow : Window
MessageBox.Show(this, ex.StackTrace, "Fehler");
}
}
private async void MnIAdSetRename_OnClick(object? sender, RoutedEventArgs e)
{
if (LstCustomerAdressSets.SelectedItems.Count > 0)
try
{
var result = await NamingWindow.Show(this);
if (result != null)
{
var id = KasAddressList.GetIDByAddressSetListItem(LstCustomerAdressSets.SelectedItems[0]
.ToString());
var cus_id = Customer.GetIDByCustomerListItem(LstCustomers.SelectedItems[0].ToString());
foreach (var set in Settings._instance.addressSets.addresses)
if (set.ID == id)
{
set.Name = result;
Settings.Save();
RefreshAddressSetListItems(cus_id);
break;
}
}
}
catch (Exception ex)
{
MessageBox.Show(this, ex.StackTrace, "Fehler");
}
}
}

View File

@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
mc:Ignorable="d" SizeToContent="WidthAndHeight"
x:Class="Logof_Client.NamingWindow"
Title="NamingWindow">
<StackPanel Orientation="Vertical">