2 Commits

Author SHA1 Message Date
fierke 1580d30d72 [chore:] ui element disableing (customer settings) 2026-05-27 08:42:25 +02:00
fierke 0dacaf19b9 [chore:] control name 2026-05-27 08:41:42 +02:00
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -485,7 +485,7 @@
TextChanged="TbSettingsCustomerSenderAddress_OnTextChanged"
x:Name="TbSettingsCustomerSenderAddress" />
</Grid>
<Grid ColumnDefinitions="150,*,Auto">
<Grid ColumnDefinitions="150,*,Auto" x:Name="GrdCSVDividerButtonsAndTb">
<Label Content="CSV-Trennzeichen" />
<TextBox Grid.Column="1" Watermark=","
HorizontalAlignment="Stretch" Margin="0,0,5,0"
+12
View File
@@ -28,6 +28,7 @@ public partial class MainWindow : Window
Logger.Log($"Session on {DateTime.Now:G}");
Logger.Log("Initializing...");
InitializeComponent();
SetSettingsCustomerEnabledState(false);
//Hide();
var s = new StartupWindow();
@@ -484,6 +485,7 @@ public partial class MainWindow : Window
private void LstSettingsCustomers_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
{
SetSettingsCustomerEnabledState(false);
if (LstSettingsCustomers.SelectedIndex < 0) return;
Settings._instance.customers.current =
((Customer)LstSettingsCustomers.SelectedItems[0]);
@@ -498,9 +500,19 @@ public partial class MainWindow : Window
TbSettingsCustomerPatchInfo.Text = Settings._instance.customers.current.patch.ToString();
else
TbSettingsCustomerPatchInfo.Text = "";
SetSettingsCustomerEnabledState();
//}
}
private void SetSettingsCustomerEnabledState(bool enable = true)
{
List<Object> nboom = new() { BtnSettingsImportCustomerAddressPatch, GrdCSVDividerButtonsAndTb, TbSettingsCustomerDescription, TbSettingsCustomerName, BtnDeleteCustomer, TbSettingsCustomerSenderAddress};
foreach (var obj in nboom)
{
(obj as Control).IsEnabled = enable;
}
}
private async void EditButton_Click(object? sender, RoutedEventArgs e)
{
if (string.IsNullOrWhiteSpace(_selectedWikiFilePath))