From 93d9dc7860941795d08cd6b5c1903c2ab3ce7585 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Fri, 8 Nov 2024 09:55:48 +0100 Subject: [PATCH] fix last remaining issues in MainWindow --- Avalonia.EliteBGS/MainWindow.axaml.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Avalonia.EliteBGS/MainWindow.axaml.cs b/Avalonia.EliteBGS/MainWindow.axaml.cs index bd3d67b..c09645b 100644 --- a/Avalonia.EliteBGS/MainWindow.axaml.cs +++ b/Avalonia.EliteBGS/MainWindow.axaml.cs @@ -150,9 +150,6 @@ public partial class MainWindow : Window { DateTime today = DateTime.Today; DateTime tomorrow = today.AddDays(1); - // HOCHKULTUR - startdate.Culture = enddate.Culture = CultureInfo.GetCultureInfo("de-AT"); - startdate.SelectedDate = today; enddate.SelectedDate = tomorrow; } @@ -169,7 +166,7 @@ public partial class MainWindow : Window { builder.Append(message); builder.Append("\n"); - log.AppendText(builder.ToString()); + log.Text = log.Text + builder.ToString(); } private void Log(string message) { @@ -364,7 +361,7 @@ public partial class MainWindow : Window { } private void RefreshView() { - entries.Items.Refresh(); + //entries.Items.Refresh(); GenerateLog(); } @@ -524,7 +521,7 @@ public partial class MainWindow : Window { startdate.SelectedDate = ResetTimeToZero(d.Value); } - d = enddate.SelectedDate; + d = enddate.SelectedDate?.Date; if (d != null) { enddate.SelectedDate = ResetTimeToZero(d.Value); } @@ -608,7 +605,7 @@ public partial class MainWindow : Window { Name = "Discord Server Name", Webhook = "..." }); - Webhooks.Items.Refresh(); + //Webhooks.Items.Refresh(); RefreshPostMenu(); } @@ -624,17 +621,17 @@ public partial class MainWindow : Window { foreach (var item in selection) { Config.Global.Webhooks.Remove(item); } - Webhooks.Items.Refresh(); + //Webhooks.Items.Refresh(); RefreshPostMenu(); } private void Webhooks_KeyUp(object sender, KeyEventArgs e) { - DataGridCell cell = e.OriginalSource as DataGridCell; + DataGridCell cell = e.Source as DataGridCell; /* We also get keypresses from DataGridCells that are currently * editing their content. Filter those out. We don't want to delete * the row when the user presses DEL while editing the cells content */ - if (cell == null || cell.IsEditing) { + if (cell == null) { return; } if (e.Key == Key.Delete) {