mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
CmdPal: Implement IDetailsCommand in details (#39911)
Implemented IDetailsCommands in details. This will close #38339. This works very similar to Tags in that it is a list of commands. This was done to allow for styling without the 12 spacing of the ItemsRepeater and looks like you'd find in the OS-inbox like:   Also added to our sample extension: 
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace SamplePagesExtension;
|
||||
|
||||
@@ -129,6 +130,25 @@ internal sealed partial class SampleListPageWithDetails : ListPage
|
||||
],
|
||||
},
|
||||
},
|
||||
new DetailsElement()
|
||||
{
|
||||
Key = "Commands",
|
||||
Data = new DetailsCommands()
|
||||
{
|
||||
Commands = [
|
||||
new ToastCommand("Hey! You clicked it!", MessageState.Success)
|
||||
{
|
||||
Name = "Do something amazing",
|
||||
Icon = new("\uE945"),
|
||||
},
|
||||
new ToastCommand("I warned you!", MessageState.Error)
|
||||
{
|
||||
Name = "Don't click me",
|
||||
Icon = new("\uEA39"),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user