[chore:] ui element disableing (customer settings)
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user