From e37c1ca386c4408bb81150c85e30a64b65c31cef Mon Sep 17 00:00:00 2001
From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
Date: Mon, 4 May 2026 01:05:58 +0900
Subject: [PATCH 1/3] Init
---
src/Files.App.Controls/Sidebar/ISidebarItemModel.cs | 5 +++++
src/Files.App.Controls/Sidebar/SidebarItem.cs | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs b/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs
index ab0e4742ae6c..ef6cfdfde7da 100644
--- a/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs
+++ b/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs
@@ -5,6 +5,11 @@ namespace Files.App.Controls
{
public interface ISidebarItemModel : INotifyPropertyChanged
{
+ ///
+ /// The filesystem path represented by this item, if any.
+ ///
+ string? Path => null;
+
///
/// The children of this item that will be rendered as child elements of the SidebarItem
///
diff --git a/src/Files.App.Controls/Sidebar/SidebarItem.cs b/src/Files.App.Controls/Sidebar/SidebarItem.cs
index ddd0a3df3dc5..9ac319ab1aff 100644
--- a/src/Files.App.Controls/Sidebar/SidebarItem.cs
+++ b/src/Files.App.Controls/Sidebar/SidebarItem.cs
@@ -92,7 +92,7 @@ public void HandleItemChange()
HookupItemChangeListener(null, Item);
UpdateExpansionState();
ReevaluateSelection();
- CanDrag = Item?.GetType().GetProperty("Path")?.GetValue(Item) is string path && Path.IsPathRooted(path);
+ CanDrag = Item?.Path is string path && Path.IsPathRooted(path);
}
private void HookupOwners()
@@ -140,7 +140,7 @@ private void HookupItemChangeListener(ISidebarItemModel? oldItem, ISidebarItemMo
private void SidebarItem_DragStarting(UIElement sender, DragStartingEventArgs args)
{
- if (Item?.GetType().GetProperty("Path")?.GetValue(Item) is not string dragPath || !Path.IsPathRooted(dragPath))
+ if (Item?.Path is not string dragPath || !Path.IsPathRooted(dragPath))
return;
args.Data.SetData(StandardDataFormats.Text, dragPath);
From a6ab9c9490047fc877dae8befd456188a94eacda Mon Sep 17 00:00:00 2001
From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
Date: Mon, 4 May 2026 01:38:57 +0900
Subject: [PATCH 2/3] Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
---
src/Files.App.Controls/Sidebar/ISidebarItemModel.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs b/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs
index ef6cfdfde7da..43f08be3f660 100644
--- a/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs
+++ b/src/Files.App.Controls/Sidebar/ISidebarItemModel.cs
@@ -8,7 +8,7 @@ public interface ISidebarItemModel : INotifyPropertyChanged
///
/// The filesystem path represented by this item, if any.
///
- string? Path => null;
+ string? Path { get; }
///
/// The children of this item that will be rendered as child elements of the SidebarItem
From edee1a9b10124c170570cf8aeee386f0f4ec7d73 Mon Sep 17 00:00:00 2001
From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
Date: Mon, 4 May 2026 17:51:13 +0900
Subject: [PATCH 3/3] Fix the build error
---
src/Files.App/ViewModels/Settings/SettingsPageViewModel.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Files.App/ViewModels/Settings/SettingsPageViewModel.cs b/src/Files.App/ViewModels/Settings/SettingsPageViewModel.cs
index f1bb4c3046d2..479f0e707d2d 100644
--- a/src/Files.App/ViewModels/Settings/SettingsPageViewModel.cs
+++ b/src/Files.App/ViewModels/Settings/SettingsPageViewModel.cs
@@ -106,6 +106,7 @@ public sealed partial class SettingsNavigationItem : ObservableObject, ISidebarI
public string AutomationId { get; }
public string Text { get; }
public ThemedIcon IconElement { get; }
+ public string? Path => null;
// ISidebarItemModel
public object? Children => null;