mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-22 10:07:37 +00:00
ValueSet it is
This commit is contained in:
parent
eef0da2d22
commit
2fee0aef2a
@ -126,10 +126,6 @@ public partial class CommandViewModel : ExtensionObjectViewModel
|
||||
var iconInfo = model.Icon;
|
||||
Icon = new(iconInfo);
|
||||
Icon.InitializeProperties();
|
||||
break;
|
||||
case nameof(_properties):
|
||||
UpdatePropertiesFromExtension(model as IExtendedAttributesProvider);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.CommandPalette.Extensions;
|
||||
using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
using Windows.Foundation;
|
||||
@ -187,11 +188,14 @@ internal sealed partial class SampleListPage : ListPage
|
||||
{
|
||||
private FontIconData _icon = new("\u0026", "Wingdings");
|
||||
|
||||
public override IconInfo Icon => new IconInfo(_icon, _icon);
|
||||
public override IconInfo Icon => new(_icon, _icon);
|
||||
|
||||
public override string Name => "Whatever";
|
||||
|
||||
public IDictionary<string, object> GetProperties() => new Dictionary<string, object>()
|
||||
// LOAD-BEARING: Use a Windows.Foundation.Collections.ValueSet as the
|
||||
// backing store for Properties. A regular `Dictionary<string, object>`
|
||||
// will not work across the ABI
|
||||
public IDictionary<string, object> GetProperties() => new Windows.Foundation.Collections.ValueSet()
|
||||
{
|
||||
{ "Foo", "bar" },
|
||||
{ "Secret", 42 },
|
||||
@ -215,7 +219,10 @@ internal sealed partial class SampleListPage : ListPage
|
||||
return CommandResult.ShowToast("whoop");
|
||||
}
|
||||
|
||||
public IDictionary<string, object> GetProperties() => new Dictionary<string, object>()
|
||||
// LOAD-BEARING: Use a Windows.Foundation.Collections.ValueSet as the
|
||||
// backing store for Properties. A regular `Dictionary<string, object>`
|
||||
// will not work across the ABI
|
||||
public IDictionary<string, object> GetProperties() => new Windows.Foundation.Collections.ValueSet()
|
||||
{
|
||||
{ "yo", "dog" },
|
||||
{ "Secret", 12345 },
|
||||
@ -242,17 +249,22 @@ internal sealed partial class SampleListPage : ListPage
|
||||
{
|
||||
private string FontFamily { get; set; }
|
||||
|
||||
private readonly Dictionary<string, object> _properties;
|
||||
// LOAD-BEARING: Use a Windows.Foundation.Collections.ValueSet as the
|
||||
// backing store for Properties. A regular `Dictionary<string, object>`
|
||||
// will not work across the ABI
|
||||
private readonly Windows.Foundation.Collections.ValueSet _properties;
|
||||
|
||||
public IDictionary<string, object>? GetProperties() => _properties;
|
||||
public IDictionary<string, object> GetProperties() => _properties;
|
||||
|
||||
public FontIconData(string glyph, string fontFamily)
|
||||
: base(glyph)
|
||||
{
|
||||
FontFamily = fontFamily;
|
||||
_properties = new Dictionary<string, object>()
|
||||
|
||||
_properties = new Windows.Foundation.Collections.ValueSet()
|
||||
{
|
||||
{ "FontFamily", FontFamily },
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user