From d0b2703f702e5bcb4d942987cf427d7a6d3682de Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Thu, 29 Oct 2026 21:46:08 +0100 Subject: [PATCH 01/11] Fix: Web Console: Close the temporary WebView2 controller if deleting the browsing data fails (C1) Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/WebConsoleSettingsViewModel.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/NETworkManager/ViewModels/WebConsoleSettingsViewModel.cs b/Source/NETworkManager/ViewModels/WebConsoleSettingsViewModel.cs index bd52d3f4f2..45753fe5e2 100644 --- a/Source/NETworkManager/ViewModels/WebConsoleSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/WebConsoleSettingsViewModel.cs @@ -149,6 +149,8 @@ private async Task DeleteBrowsingData() IsDeleteBrowsingDataStatusMessageDisplayed = false; + CoreWebView2Controller webView2Controller = null; + try { // Create a temporary WebView2 instance to clear browsing data @@ -157,12 +159,10 @@ private async Task DeleteBrowsingData() var windowHwnd = new WindowInteropHelper(Application.Current.MainWindow).Handle; - var webView2Controller = await webView2Environment.CreateCoreWebView2ControllerAsync(windowHwnd); + webView2Controller = await webView2Environment.CreateCoreWebView2ControllerAsync(windowHwnd); await webView2Controller.CoreWebView2.Profile.ClearBrowsingDataAsync(); - webView2Controller.Close(); - DeleteBrowsingDataStatusMessage = Strings.BrowsingDataSuccessfullyDeletedMessage; } catch (Exception ex) @@ -172,6 +172,11 @@ private async Task DeleteBrowsingData() DeleteBrowsingDataStatusMessage = Strings.BrowsingDataErrorMessage; } + finally + { + // Also on an error, otherwise the cache folder stays locked until the application is closed + webView2Controller?.Close(); + } IsDeleteBrowsingDataStatusMessageDisplayed = true; } From 3b06e22a76a9a42d60c3163d4c443db67644ba96 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Thu, 29 Oct 2026 21:46:29 +0100 Subject: [PATCH 02/11] Chore: Feature review conventions: Context menu DataContext via BindingProxy in XAML (C3) Co-Authored-By: Claude Opus 5.5 --- .../feature-review/references/conventions.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.claude/skills/feature-review/references/conventions.md b/.claude/skills/feature-review/references/conventions.md index 0715193403..fdfb50a29a 100644 --- a/.claude/skills/feature-review/references/conventions.md +++ b/.claude/skills/feature-review/references/conventions.md @@ -84,7 +84,19 @@ Reference: `HostsFileEditorView.xaml`, `FirewallView.xaml`. `SelectedResults` is changed in place (no change notification): selection-dependent properties are raised in `OnContextMenuOpened()` called from the view's `ContextMenu_Opened`. - Two context menus: `RowContextMenu` (one row) and `MultiRowContextMenu` (several rows), switched by a - `DataTrigger` on `SelectedItems.Count`. `Opened="ContextMenu_Opened"` sets the menu's `DataContext`. + `DataTrigger` on `SelectedItems.Count`. +- A context menu is not part of the visual tree and doesn't inherit the `DataContext`: the menu gets + `DataContext="{Binding Data, Source={StaticResource BindingProxy}}"` in XAML, with + `` in the view's own resources, declared before + the menus. The bindings inside the menu are plain bindings (`{Binding EditEntryCommand}`). Don't set the + `DataContext` in `ContextMenu_Opened` (until the menu is opened, its bindings fail and are logged as XAML binding + errors). `Opened` is only for extra work, e.g. `OnContextMenuOpened()` or the custom commands of the IP Scanner. +- No bindings that have no element to resolve against: no `VisualBrush` / `BitmapImage` with a binding in a style + setter or as a freezable resource. Bind the property of the element with a converter instead + (`VisualToVisualBrushConverter`, `ApplicationNameToIconBrushConverter`, `Image Source="{Binding Uri}"`). A static + `VisualBrush` (`Visual="{iconPacks:Material Kind=...}"`) is fine. `MenuItem`s created outside a menu (e.g. extra + items in an `x:Array`) are fine: the implicit `DefaultMenuItem` style sets the content alignment directly instead + of the MahApps binding to the parent. New `MenuItem` styles are `BasedOn="{StaticResource DefaultMenuItem}"`. - Order: Enable / Disable (only the applicable one) → Edit... → Copy as... → Delete → separator → Copy (submenu, `CopyMenuItem` style) → Export... - Icons (16×16 `Rectangle`, `MahApps.Brushes.Gray3`, `VisualBrush`): Enable `Material ToggleSwitchOutline`, From 6b790364bde0c37b41fa395eee5df5eccb86a8e2 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Thu, 29 Oct 2026 21:46:37 +0100 Subject: [PATCH 03/11] Chore: SNMP / Server profiles dialog: Remove nested BindingProxy (C6) The top-level BindingProxy (added for the context menus) has the same key and the same view model, the nested copies are no longer needed. Co-Authored-By: Claude Opus 5.5 --- Source/NETworkManager/Views/SNMPView.xaml | 3 --- .../Views/ServerConnectionInfoProfileChildWindow.xaml | 6 ------ 2 files changed, 9 deletions(-) diff --git a/Source/NETworkManager/Views/SNMPView.xaml b/Source/NETworkManager/Views/SNMPView.xaml index aecf87e9d0..1fb606ce28 100644 --- a/Source/NETworkManager/Views/SNMPView.xaml +++ b/Source/NETworkManager/Views/SNMPView.xaml @@ -102,9 +102,6 @@ x:Name="ComboBoxOid" ItemsSource="{Binding OidHistoryView}" IsReadOnly="{Binding IsRunning}"> - - -