Repository: files-community/Files
File: src/Files.App/ViewModels/UserControls/SidebarViewModel.cs (C#)

Code before:
						ThemedIconStyle = "App.ThemedIcons.Properties",
					},
					Command = OpenPropertiesCommand,
					CommandParameter = menu,
					IsPrimary = true,
					ShowItem = options.ShowProperties
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.PinFolderToSidebar.GetLocalizedResource(),
					ThemedIconModel = new ThemedIconModel()
					{
						ThemedIconStyle = "App.ThemedIcons.FavoritePin",
					},
					Command = PinItemCommand,
					ShowItem = isDriveItem && !isDriveItemPinned && UserSettingsService.GeneralSettingsService.ShowPinToSideBar
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.UnpinFolderFromSidebar.GetLocalizedResource(),
					ThemedIconModel = new ThemedIconModel()
					{
						ThemedIconStyle = "App.ThemedIcons.FavoritePinRemove",
					},
					Command = UnpinItemCommand,
					ShowItem = (options.ShowUnpinItem || isDriveItemPinned) && UserSettingsService.GeneralSettingsService.ShowPinToSideBar
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.ReorderSidebarItemsDialogText.GetLocalizedResource(),
					Glyph = "\uE8D8",
					Command = ReorderItemsCommand,
					ShowItem = isPinnedItem || item.Section is SectionType.Pinned
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = string.Format(Strings.SideBarHideSectionFromSideBar_Text.GetLocalizedResource(), rightClickedItem.Text),
					Glyph = "\uE77A",
					Command = HideSectionCommand,
					ShowItem = options.ShowHideSection
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.Eject.GetLocalizedResource(),
					Command = EjectDeviceCommand,
					ShowItem = options.ShowEjectDevice
				},
				new ContextMenuFlyoutItemViewModel()
				{
					ItemType = ContextMenuFlyoutItemType.Separator,
					ShowItem = (UserSettingsService.GeneralSettingsService.ShowOpenTerminal && Commands.OpenTerminalFromSidebar.IsExecutable) ||

Review comment (suggestion):
Should the setting apply to the sidebar context menu? On the one hand, users have to manually turn the off the menu item and should understand why it's missing, but I can also see a scenario where users start asking us how to unpin items.

Code after:
						ThemedIconStyle = "App.ThemedIcons.Properties",
					},
					Command = OpenPropertiesCommand,
					CommandParameter = menu,
					IsPrimary = true,
					ShowItem = options.ShowProperties
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.PinFolderToSidebar.GetLocalizedResource(),
					ThemedIconModel = new ThemedIconModel()
					{
						ThemedIconStyle = "App.ThemedIcons.FavoritePin",
					},
					Command = PinItemCommand,
					ShowItem = isDriveItem && !isDriveItemPinned
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.UnpinFolderFromSidebar.GetLocalizedResource(),
					ThemedIconModel = new ThemedIconModel()
					{
						ThemedIconStyle = "App.ThemedIcons.FavoritePinRemove",
					},
					Command = UnpinItemCommand,
					ShowItem = options.ShowUnpinItem || isDriveItemPinned
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.ReorderSidebarItemsDialogText.GetLocalizedResource(),
					Glyph = "\uE8D8",
					Command = ReorderItemsCommand,
					ShowItem = isPinnedItem || item.Section is SectionType.Pinned
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = string.Format(Strings.SideBarHideSectionFromSideBar_Text.GetLocalizedResource(), rightClickedItem.Text),
					Glyph = "\uE77A",
					Command = HideSectionCommand,
					ShowItem = options.ShowHideSection
				},
				new ContextMenuFlyoutItemViewModel()
				{
					Text = Strings.Eject.GetLocalizedResource(),
					Command = EjectDeviceCommand,
					ShowItem = options.ShowEjectDevice
				},
				new ContextMenuFlyoutItemViewModel()
				{
					ItemType = ContextMenuFlyoutItemType.Separator,
					ShowItem = (UserSettingsService.GeneralSettingsService.ShowOpenTerminal && Commands.OpenTerminalFromSidebar.IsExecutable) ||