Initial orderby on primary items
This commit is contained in:
@@ -6,11 +6,12 @@ namespace Hyperbar.Windows.Primary;
|
||||
[JsonDerivedType(typeof(ProcessCommandConfiguration), typeDiscriminator: "ProcessCommand")]
|
||||
public class PrimaryCommandConfiguration
|
||||
{
|
||||
public required Guid Id { get; set; }
|
||||
|
||||
public List<PrimaryCommandConfiguration> Commands { get; set; } = [];
|
||||
public required string Icon { get; set; }
|
||||
|
||||
public required string Text { get; set; }
|
||||
public required Guid Id { get; set; }
|
||||
|
||||
public List<PrimaryCommandConfiguration> Commands { get; set; } = [];
|
||||
public required int Order { get; set; }
|
||||
|
||||
public required string Text { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,6 @@ public class PrimaryWidgetConfiguration :
|
||||
{
|
||||
public static PrimaryWidgetConfiguration Defaults => new()
|
||||
{
|
||||
new KeyAcceleratorCommandConfiguration { Id = Guid.NewGuid(), Icon = "\uE720", Text = "Test", Key = 91, Modifiers = [] }
|
||||
new KeyAcceleratorCommandConfiguration { Id = Guid.NewGuid(), Order = 1, Icon = "\uE720", Text = "Test", Key = 91, Modifiers = [] }
|
||||
};
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public class WidgetComponentViewModelEnumerator(PrimaryWidgetConfiguration confi
|
||||
{
|
||||
public IEnumerable<IWidgetComponentViewModel?> Next()
|
||||
{
|
||||
foreach (PrimaryCommandConfiguration item in configuration)
|
||||
foreach (PrimaryCommandConfiguration item in configuration.OrderBy(x => x.Order))
|
||||
{
|
||||
yield return factory.Create(item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user