mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
CmdPal: Add Context Menu command "Show Details" when list item has details, but list view's ShowDetails == false (#40870)
Closes #38270 When a list item's `Details` property is not null, but it's parent ListViews `ShowDetails` property is false, this PR adds a context menu item at the bottom of the commands for the list item to show details. Clicking that command will show the details for the selected item, but the details pane will hide when a different item is selected. ## Preview https://github.com/user-attachments/assets/7b5cd3d4-b4ae-433a-ad25-f620590cd261 --------- Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com> Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Shawn Yuan <shuaiyuan@microsoft.com>
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Diagnostics;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using ManagedCommon;
|
||||
using Microsoft.CmdPal.Core.ViewModels;
|
||||
using Microsoft.CmdPal.Core.ViewModels.Commands;
|
||||
using Microsoft.CmdPal.Core.ViewModels.Messages;
|
||||
using Microsoft.CmdPal.UI.Helpers;
|
||||
using Microsoft.CmdPal.UI.Messages;
|
||||
@@ -386,8 +387,6 @@ public sealed partial class ListPage : Page,
|
||||
ItemView.SelectedItem = item;
|
||||
}
|
||||
|
||||
ViewModel?.UpdateSelectedItemCommand.Execute(item);
|
||||
|
||||
if (!e.TryGetPosition(element, out var pos))
|
||||
{
|
||||
pos = new(0, element.ActualHeight);
|
||||
|
||||
Reference in New Issue
Block a user