Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Files/UserControls/ModernSidebar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@
<ResourceDictionary>
<MenuFlyout x:Name="SideBarItemContextFlyout" x:FieldModifier="public">
<MenuFlyout.Items>
<MenuFlyoutItem
x:Name="EmptyRecycleBin"
x:Uid="BaseLayoutContextFlyoutEmptyRecycleBin"
x:Load="{x:Bind ShowEmptyRecycleBin, Mode=OneWay}"
Click="{x:Bind local1:App.CurrentInstance.InteractionOperations.EmptyRecycleBin_ClickAsync}"
Text="Empty recycle bin" />
<MenuFlyoutItem
x:Name="OpenInNewTab"
x:Uid="SideBarOpenInNewTab"
Expand Down
27 changes: 27 additions & 0 deletions Files/UserControls/ModernSidebar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ public bool ShowUnpinItem
}
}

private bool _ShowEmptyRecycleBin;

public bool ShowEmptyRecycleBin
{
get
{
return _ShowEmptyRecycleBin;
}
set
{
if (value != _ShowEmptyRecycleBin)
{
_ShowEmptyRecycleBin = value;
NotifyPropertyChanged("ShowEmptyRecycleBin");
}
}
}

public event PropertyChangedEventHandler PropertyChanged;

private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
Expand Down Expand Up @@ -125,6 +143,15 @@ private void NavigationViewLocationItem_RightTapped(object sender, RightTappedRo
ShowUnpinItem = true;
}

if (item.Path.Equals(App.AppSettings.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
{
ShowEmptyRecycleBin = true;
}
else
{
ShowEmptyRecycleBin = false;
}

SideBarItemContextFlyout.ShowAt(sidebarItem, e.GetPosition(sidebarItem));
App.rightClickedItem = item;
}
Expand Down
Loading