Skip to content

Commit f3bf40f

Browse files
authored
Added support for unpinning recycle bin from the sidebar (#1240)
1 parent eb52dcf commit f3bf40f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Files/App.xaml.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,14 @@ private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
168168

169169
public static void UnpinItem_Click(object sender, RoutedEventArgs e)
170170
{
171-
SidebarPinned.RemoveItem(rightClickedItem.Path.ToString());
171+
if (rightClickedItem.Path.Equals(App.AppSettings.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
172+
{
173+
AppSettings.PinRecycleBinToSideBar = false;
174+
}
175+
else
176+
{
177+
SidebarPinned.RemoveItem(rightClickedItem.Path.ToString());
178+
}
172179
}
173180

174181
public static void Clipboard_ContentChanged(object sender, object e)

Files/UserControls/SidebarControl.cs

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ private void NavigationViewLocationItem_RightTapped(object sender, RightTappedRo
145145
if (item.Path.Equals(App.AppSettings.RecycleBinPath, StringComparison.OrdinalIgnoreCase))
146146
{
147147
ShowEmptyRecycleBin = true;
148+
ShowUnpinItem = true;
148149
}
149150
else
150151
{

0 commit comments

Comments
 (0)