Skip to content

Commit f268e1e

Browse files
committed
Squashed commit of the following:
commit 13385cb Author: Anoop-2024si96509 <2024si96509@wilp.bits-pilani.ac.in> Date: Tue Jan 6 00:36:45 2026 +0530 Fix: Fixed an issue where file types displayed differently for hidden items (files-community#18018) commit 124e1fc Author: Saravanan G <workbysaran@gmail.com> Date: Mon Jan 5 21:29:05 2026 +0530 Fix: Fixed an issue where search didn't work for tags with spaces in their name (files-community#18020) commit c1484c2 Author: Steve <hez2010@outlook.com> Date: Mon Jan 5 00:54:06 2026 +0900 Code Quality: Cleanup warnings (files-community#18011) Signed-off-by: Steve <hez2010@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> commit 528be10 Author: Saravanan G <workbysaran@gmail.com> Date: Thu Jan 1 01:49:38 2026 +0530 Fix: Prevent "Failed to enqueue the operation" exception during shutdown (files-community#18006) commit babc715 Author: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Mon Dec 29 07:27:11 2025 +0900 Code Quality: Suppress exceptions that can occur in SidebarView drag/drop event handlers (files-community#17996) commit 01ddde9 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Thu Dec 25 16:38:12 2025 -0500 Build: v4.0.24 commit 3ad75f1 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Thu Dec 25 16:37:34 2025 -0500 Code Quality: Updated translations (files-community#17997) commit e21ef88 Author: seer-by-sentry[bot] <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Tue Dec 23 19:46:54 2025 -0500 Fix: Added null checks for ShellViewModel in navigation helpers (files-community#17963) Signed-off-by: Yair <39923744+yaira2@users.noreply.github.com> Co-authored-by: seer-by-sentry[bot] <157164994+seer-by-sentry[bot]@users.noreply.github.com> Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com> Co-authored-by: hishitetsu <66369541+hishitetsu@users.noreply.github.com> commit 25bdcd1 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon Dec 22 18:32:10 2025 -0500 Build: v4.0.23 commit 6721e58 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon Dec 22 18:27:25 2025 -0500 Code Quality: Updated translations (files-community#17986) commit 0c21660 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon Dec 22 17:47:00 2025 -0500 Feature: Added text wrapping to Status Center (files-community#17985) commit 9afe596 Author: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Tue Dec 23 01:43:23 2025 +0900 Code Quality: Removed ISidebarViewModel (files-community#17972) commit 347c35d Author: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Sun Dec 21 08:40:37 2025 +0900 GitHub: Removed the extra link space between the download badges (files-community#17975) commit bb05ce1 Author: Saravanan G <workbysaran@gmail.com> Date: Fri Dec 19 20:53:32 2025 +0530 Feature: Added Copy functionality to sidebar and home page widgets (files-community#17969) commit 472347c Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Dec 18 10:45:37 2025 -0500 Bump Microsoft.WindowsAppSDK from 1.8.250907003 to 1.8.251106002 (files-community#17974) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 81aa50c Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Dec 18 10:45:27 2025 -0500 Bump Microsoft.Windows.SDK.BuildTools from 10.0.26100.4948 to 10.0.26100.7175 (files-community#17973) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit e49e479 Author: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu Dec 18 02:55:24 2025 +0900 Feature: Added theme shadow to Omnibar flyout (files-community#17971) commit 1d66171 Author: Marlen Halvorsen <marlenhalvorsen@gmail.com> Date: Wed Dec 17 00:53:29 2025 +0100 Feature: Added default name when creating new files (files-community#17942) Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com> commit 014d34d Author: Saravanan G <workbysaran@gmail.com> Date: Tue Dec 16 21:01:41 2025 +0530 Code Quality: Additional logs to troubleshoot crashes (files-community#17955) commit f56c965 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon Dec 15 12:18:46 2025 -0500 Code Quality: Change provider detection order in PreviewPopupService Moved PowerToysPeekProvider availability check after QuickLookProvider and SeerProProvider in GetProviderAsync. This alters the priority in which preview providers are selected. commit 929c304 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Sun Dec 14 10:19:27 2025 -0500 Build: v4.0.22 Signed-off-by: Yair <39923744+yaira2@users.noreply.github.com> commit 7def439 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed Dec 10 18:19:38 2025 -0500 Feature: Added support for PowerToys Peek (files-community#17954) commit 6cca0bb Author: Saravanan G <workbysaran@gmail.com> Date: Wed Dec 10 21:17:46 2025 +0530 Fix: Fixed crash that would sometimes occur when resizing the window (files-community#17893) commit e7eaf16 Author: Barton Milnor Mallory <erhebend@protonmail.com> Date: Tue Dec 9 18:24:54 2025 -0600 Code Quality: Fixed typos in code comments (files-community#17945) commit ddeb2ff Author: Saravanan G <workbysaran@gmail.com> Date: Thu Dec 4 00:53:07 2025 +0530 Fix: Fixed crash when switching git branches during merge conflict (files-community#17894) Signed-off-by: Saravanan G <workbysaran@gmail.com> Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com> commit 4abd5f2 Author: Kalmix <87293493+kalmix@users.noreply.github.com> Date: Wed Dec 3 11:34:58 2025 -0400 Fix: Fixed PNG-based .ico files rendering with black backgrounds (files-community#17924)
1 parent fe163ab commit f268e1e

File tree

145 files changed

+2003
-1006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+2003
-1006
lines changed

.github/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@ You can also use the preview version alongside the stable release to get early a
2626
<a style="text-decoration:none" href="https://apps.microsoft.com/detail/9NGHP3DX8HDX?launch=true&mode=full">
2727
<picture>
2828
<source media="(prefers-color-scheme: light)" srcset="./assets/StoreBadge-dark.png" height="80" />
29-
<img src="./assets/StoreBadge-light.png" height="80" />
30-
</picture>
31-
</a>
29+
<img src="./assets/StoreBadge-light.png" height="80" /></picture></a>
3230
&ensp;
3331
<!-- Classic Installer Badge -->
3432
<a style="text-decoration:none" href="https://files.community/appinstallers/Files.stable.appinstaller">
3533
<picture>
3634
<source media="(prefers-color-scheme: light)" srcset="./assets/ClassicInstallerBadge-dark.png" height="80" />
37-
<img src="./assets/ClassicInstallerBadge-light.png" height="80" />
38-
</picture>
39-
</a>
35+
<img src="./assets/ClassicInstallerBadge-light.png" height="80" /></picture></a>
4036
</p>
4137

4238
## Building from source

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
<MinimalWindowsVersion>10.0.19041.0</MinimalWindowsVersion>
77
<WindowsSdkPackageVersion>10.0.26100.67-preview</WindowsSdkPackageVersion>
88
<WindowsTargetFramework>$(TargetFrameworkVersion)-windows$(TargetWindowsVersion)</WindowsTargetFramework>
9+
<LangVersion>preview</LangVersion>
910
</PropertyGroup>
1011
</Project>

Directory.Packages.props

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,47 @@
1010
<PackageVersion Include="CommunityToolkit.Labs.WinUI.DependencyPropertyGenerator" Version="0.1.250206-build.2040" />
1111
<PackageVersion Include="CommunityToolkit.Labs.WinUI.Shimmer" Version="0.1.250206-build.2040" />
1212
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
13-
<PackageVersion Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.250402" />
14-
<PackageVersion Include="CommunityToolkit.WinUI.Controls.ColorPicker" Version="8.2.250402" />
15-
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
16-
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
17-
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.250402" />
18-
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
19-
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
20-
<PackageVersion Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
21-
<PackageVersion Include="CommunityToolkit.WinUI.Triggers" Version="8.2.250402" />
13+
<PackageVersion Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.251219" />
14+
<PackageVersion Include="CommunityToolkit.WinUI.Controls.ColorPicker" Version="8.2.251219" />
15+
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.251219" />
16+
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.251219" />
17+
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.251219" />
18+
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.2.251219" />
19+
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.2.251219" />
20+
<PackageVersion Include="CommunityToolkit.WinUI.Helpers" Version="8.2.251219" />
21+
<PackageVersion Include="CommunityToolkit.WinUI.Triggers" Version="8.2.251219" />
2222
<PackageVersion Include="DiscUtils.Udf" Version="0.16.13" />
23-
<PackageVersion Include="FluentFTP" Version="52.1.0" />
24-
<PackageVersion Include="LibGit2Sharp" Version="0.30.0" /> <!-- Note, 0.31 causes issues with repos cloned via ssh -->
23+
<PackageVersion Include="FluentFTP" Version="53.0.2" />
24+
<!-- Note, 0.31 causes issues with repos cloned via ssh -->
25+
<PackageVersion Include="LibGit2Sharp" Version="0.30.0" />
2526
<PackageVersion Include="MessageFormat" Version="7.1.3" />
2627
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="9.0.9" />
2728
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
2829
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
2930
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.9" />
30-
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4948" />
31+
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7175" />
3132
<PackageVersion Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
3233
<PackageVersion Include="OwlCore.Storage" Version="0.14.0" />
33-
<PackageVersion Include="Sentry" Version="5.10.0" />
34+
<PackageVersion Include="Sentry" Version="6.0.0" />
3435
<PackageVersion Include="SevenZipSharp" Version="1.0.2" />
3536
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
36-
<PackageVersion Include="SQLitePCLRaw.bundle_green" Version="2.1.10" />
37-
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.8.250907003" />
37+
<PackageVersion Include="SQLitePCLRaw.bundle_green" Version="2.1.11" />
38+
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.8.251106002" />
3839
<PackageVersion Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
3940
<PackageVersion Include="TagLibSharp" Version="2.3.0" />
4041
<PackageVersion Include="Tulpep.ActiveDirectoryObjectPicker" Version="3.0.11" />
4142
<PackageVersion Include="UTF.Unknown" Version="2.6.0" />
42-
<PackageVersion Include="WinUIEx" Version="2.5.1" /> <!-- Note, updating WinUIEx seems to cause an increase in crashes -->
43+
<!-- Note, updating WinUIEx seems to cause an increase in crashes -->
44+
<PackageVersion Include="WinUIEx" Version="2.5.1" />
4345
<PackageVersion Include="Vanara.Windows.Extensions" Version="4.0.1" />
4446
<PackageVersion Include="Vanara.Windows.Shell" Version="4.0.1" />
4547
<PackageVersion Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
4648
<PackageVersion Include="Microsoft.Management.Infrastructure.Runtime.Win" Version="3.0.0" />
4749
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
48-
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.183" />
49-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
50+
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.264" />
51+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
5052
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="4.14.0" />
51-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0" />
53+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0" />
5254
<PackageVersion Include="PolySharp" Version="1.15.0" />
5355
<PackageVersion Include="System.Text.Json" Version="9.0.9" />
5456
<PackageVersion Include="System.IO.Hashing" Version="9.0.9" />

src/Files.App (Package)/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Identity
1717
Name="FilesDev"
1818
Publisher="CN=Files"
19-
Version="4.0.21.0" />
19+
Version="4.0.24.0" />
2020

2121
<Properties>
2222
<DisplayName>Files - Dev</DisplayName>

src/Files.App.Controls/Omnibar/Omnibar.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@
8989
Background="{ThemeResource AutoSuggestBoxSuggestionsListBackground}"
9090
BorderBrush="{ThemeResource AutoSuggestBoxSuggestionsListBorderBrush}"
9191
BorderThickness="{ThemeResource AutoSuggestListBorderThemeThickness}"
92-
CornerRadius="{ThemeResource OverlayCornerRadius}">
92+
CornerRadius="{ThemeResource OverlayCornerRadius}"
93+
Translation="0,0,32">
94+
<Border.Shadow>
95+
<ThemeShadow />
96+
</Border.Shadow>
9397
<ListView
9498
x:Name="PART_SuggestionsListView"
9599
MaxHeight="{ThemeResource AutoSuggestListMaxHeight}"

src/Files.App.Controls/Sidebar/ISidebarViewModel.cs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,8 @@
77

88
namespace Files.App.Controls
99
{
10+
public record ItemInvokedEventArgs(PointerUpdateKind PointerUpdateKind) { }
1011
public record ItemDroppedEventArgs(object DropTarget, DataPackageView DroppedItem, SidebarItemDropPosition dropPosition, DragEventArgs RawEvent) { }
1112
public record ItemDragOverEventArgs(object DropTarget, DataPackageView DroppedItem, SidebarItemDropPosition dropPosition, DragEventArgs RawEvent) { }
1213
public record ItemContextInvokedArgs(object? Item, Point Position) { }
13-
14-
public interface ISidebarViewModel
15-
{
16-
/// <summary>
17-
/// The source/list of items that will be rendered in the sidebar
18-
/// </summary>
19-
object SidebarItems { get; }
20-
21-
/// <summary>
22-
/// Gets invoked when the context was requested for an item in the sidebar.
23-
/// Also applies when context was requested for the pane itsself.
24-
/// </summary>
25-
/// <param name="sender">The sender of this event</param>
26-
/// <param name="args">The <see cref="ItemContextInvokedArgs"/> for this event.</param>
27-
void HandleItemContextInvokedAsync(object sender, ItemContextInvokedArgs args);
28-
29-
/// <summary>
30-
/// Gets invoked when an item drags over any item of the sidebar.
31-
/// </summary>
32-
/// <param name="args">The <see cref="ItemDragOverEventArgs"/> for this event.</param>
33-
/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns>
34-
Task HandleItemDragOverAsync(ItemDragOverEventArgs args);
35-
36-
/// <summary>
37-
/// Gets invoked when an item is dropped on any item of the sidebar.
38-
/// </summary>
39-
/// <param name="args">The <see cref="ItemDroppedEventArgs"/> for this event.</param>
40-
/// <returns>A <see cref="Task"/> that represents the asynchronous operation.</returns>
41-
Task HandleItemDroppedAsync(ItemDroppedEventArgs args);
42-
43-
/// <summary>
44-
/// Gets invoked when an item is invoked (double clicked) on any item of the sidebar.
45-
/// </summary>
46-
/// <param name="item">The item that was invoked.</param>
47-
void HandleItemInvokedAsync(object item, PointerUpdateKind pointerUpdateKind);
48-
}
4914
}

src/Files.App.Controls/Sidebar/SidebarItem.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,7 @@ private async void ItemBorder_DragOver(object sender, DragEventArgs e)
404404
VisualStateManager.GoToState(this, "DragInsertBelow", true);
405405
}
406406

407-
if (Owner is not null)
408-
{
409-
var deferral = e.GetDeferral();
410-
await Owner.RaiseItemDragOver(this, insertsAbove, e);
411-
deferral.Complete();
412-
}
407+
Owner?.RaiseItemDragOver(this, insertsAbove, e);
413408
}
414409

415410
private void ItemBorder_ContextRequested(UIElement sender, Microsoft.UI.Xaml.Input.ContextRequestedEventArgs args)
@@ -423,11 +418,10 @@ private void ItemBorder_DragLeave(object sender, DragEventArgs e)
423418
UpdatePointerState();
424419
}
425420

426-
private async void ItemBorder_Drop(object sender, DragEventArgs e)
421+
private void ItemBorder_Drop(object sender, DragEventArgs e)
427422
{
428423
UpdatePointerState();
429-
if (Owner is not null)
430-
await Owner.RaiseItemDropped(this, DetermineDropTargetPosition(e), e);
424+
Owner?.RaiseItemDropped(this, DetermineDropTargetPosition(e), e);
431425
}
432426

433427
private SidebarItemDropPosition DetermineDropTargetPosition(DragEventArgs args)

src/Files.App.Controls/Sidebar/SidebarItemAutomationPeer.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
namespace Files.App.Controls
1111
{
12+
/// <summary>
13+
/// Exposes <see cref="SidebarItem"/> types to Microsoft UI Automation.
14+
/// </summary>
1215
public sealed partial class SidebarItemAutomationPeer : FrameworkElementAutomationPeer, IInvokeProvider, IExpandCollapseProvider, ISelectionItemProvider
1316
{
1417
public ExpandCollapseState ExpandCollapseState
@@ -17,6 +20,7 @@ public ExpandCollapseState ExpandCollapseState
1720
{
1821
if (Owner.HasChildren)
1922
return Owner.IsExpanded ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed;
23+
2024
return ExpandCollapseState.LeafNode;
2125
}
2226
}
@@ -27,7 +31,7 @@ public ExpandCollapseState ExpandCollapseState
2731

2832
public SidebarItemAutomationPeer(SidebarItem owner) : base(owner)
2933
{
30-
this.Owner = owner;
34+
Owner = owner;
3135
}
3236

3337
protected override AutomationControlType GetAutomationControlTypeCore()
@@ -49,28 +53,22 @@ protected override object GetPatternCore(PatternInterface patternInterface)
4953
else if (patternInterface == PatternInterface.ExpandCollapse)
5054
{
5155
if (Owner.CollapseEnabled)
52-
{
5356
return this;
54-
}
5557
}
58+
5659
return base.GetPatternCore(patternInterface);
5760
}
5861

5962
public void Collapse()
6063
{
6164
if (Owner.CollapseEnabled)
62-
{
6365
Owner.IsExpanded = false;
64-
}
6566
}
6667

6768
public void Expand()
6869
{
69-
7070
if (Owner.CollapseEnabled)
71-
{
7271
Owner.IsExpanded = true;
73-
}
7472
}
7573

7674
public void Invoke()
@@ -106,13 +104,11 @@ protected override int GetPositionInSetCore()
106104
private IList GetOwnerCollection()
107105
{
108106
if (Owner.FindAscendant<SidebarItem>() is SidebarItem parent && parent.Item?.Children is IList list)
109-
{
110107
return list;
111-
}
112-
if (Owner?.Owner is not null && Owner.Owner.ViewModel.SidebarItems is IList items)
113-
{
108+
109+
if (Owner?.Owner is not null && Owner.Owner?.MenuItemsSource is IList items)
114110
return items;
115-
}
111+
116112
return new List<object>();
117113
}
118114
}

src/Files.App.Controls/Sidebar/SidebarView.Properties.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ public double NegativeOpenPaneLength
6565
public static readonly DependencyProperty NegativeOpenPaneLengthProperty =
6666
DependencyProperty.Register(nameof(NegativeOpenPaneLength), typeof(double), typeof(SidebarView), new PropertyMetadata(null));
6767

68-
public ISidebarViewModel ViewModel
69-
{
70-
get => (ISidebarViewModel)GetValue(ViewModelProperty);
71-
set => SetValue(ViewModelProperty, value);
72-
}
73-
public static readonly DependencyProperty ViewModelProperty =
74-
DependencyProperty.Register(nameof(ViewModel), typeof(ISidebarViewModel), typeof(SidebarView), new PropertyMetadata(null));
75-
7668
public ISidebarItemModel SelectedItem
7769
{
7870
get => (ISidebarItemModel)GetValue(SelectedItemProperty);

src/Files.App.Controls/Sidebar/SidebarView.xaml.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ public sealed partial class SidebarView : UserControl, INotifyPropertyChanged
1515
{
1616
private const double COMPACT_MAX_WIDTH = 200;
1717

18-
public event EventHandler<object>? ItemInvoked;
18+
public event EventHandler<ItemInvokedEventArgs>? ItemInvoked;
1919
public event EventHandler<ItemContextInvokedArgs>? ItemContextInvoked;
20+
public event EventHandler<ItemDragOverEventArgs>? ItemDragOver;
21+
public event EventHandler<ItemDroppedEventArgs>? ItemDropped;
2022
public event PropertyChangedEventHandler? PropertyChanged;
2123

2224
internal SidebarItem? SelectedItemContainer = null;
@@ -40,26 +42,24 @@ internal void RaiseItemInvoked(SidebarItem item, PointerUpdateKind pointerUpdate
4042
if (item.Item is null || item.IsGroupHeader) return;
4143

4244
SelectedItem = item.Item;
43-
ItemInvoked?.Invoke(item, item.Item);
44-
ViewModel.HandleItemInvokedAsync(item.Item, pointerUpdateKind);
45+
ItemInvoked?.Invoke(item, new(pointerUpdateKind));
4546
}
4647

4748
internal void RaiseContextRequested(SidebarItem item, Point e)
4849
{
49-
ItemContextInvoked?.Invoke(item, new ItemContextInvokedArgs(item.Item, e));
50-
ViewModel.HandleItemContextInvokedAsync(item, new ItemContextInvokedArgs(item.Item, e));
50+
ItemContextInvoked?.Invoke(item, new(item.Item, e));
5151
}
5252

53-
internal async Task RaiseItemDropped(SidebarItem sideBarItem, SidebarItemDropPosition dropPosition, DragEventArgs rawEvent)
53+
internal void RaiseItemDropped(SidebarItem sideBarItem, SidebarItemDropPosition dropPosition, DragEventArgs rawEvent)
5454
{
5555
if (sideBarItem.Item is null) return;
56-
await ViewModel.HandleItemDroppedAsync(new ItemDroppedEventArgs(sideBarItem.Item, rawEvent.DataView, dropPosition, rawEvent));
56+
ItemDropped?.Invoke(this, new(sideBarItem.Item, rawEvent.DataView, dropPosition, rawEvent));
5757
}
5858

59-
internal async Task RaiseItemDragOver(SidebarItem sideBarItem, SidebarItemDropPosition dropPosition, DragEventArgs rawEvent)
59+
internal void RaiseItemDragOver(SidebarItem sideBarItem, SidebarItemDropPosition dropPosition, DragEventArgs rawEvent)
6060
{
6161
if (sideBarItem.Item is null) return;
62-
await ViewModel.HandleItemDragOverAsync(new ItemDragOverEventArgs(sideBarItem.Item, rawEvent.DataView, dropPosition, rawEvent));
62+
ItemDragOver?.Invoke(this, new(sideBarItem.Item, rawEvent.DataView, dropPosition, rawEvent));
6363
}
6464

6565
private void UpdateMinimalMode()
@@ -230,8 +230,7 @@ private void SidebarResizer_ManipulationCompleted(object sender, ManipulationCom
230230

231231
private void MenuItemHostScrollViewer_ContextRequested(UIElement sender, ContextRequestedEventArgs e)
232232
{
233-
var newArgs = new ItemContextInvokedArgs(null, e.TryGetPosition(this, out var point) ? point : default);
234-
ViewModel.HandleItemContextInvokedAsync(this, newArgs);
233+
ItemContextInvoked?.Invoke(this, new(null, e.TryGetPosition(this, out var point) ? point : default));
235234
e.Handled = true;
236235
}
237236

0 commit comments

Comments
 (0)