wired up key commands
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
namespace Hyperbar.Windows.Primary;
|
||||
|
||||
public interface IPrimaryCommand
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Hyperbar.Windows.Primary;
|
||||
|
||||
public interface IPrimaryCommandConfiguration
|
||||
{
|
||||
}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
namespace Hyperbar.Windows.Primary;
|
||||
|
||||
public class KeyAcceleratorCommand :
|
||||
IPrimaryCommand
|
||||
public class KeyAcceleratorCommandConfiguration :
|
||||
IPrimaryCommandConfiguration
|
||||
{
|
||||
public string? Icon { get; set; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Hyperbar.Windows.Primary;
|
||||
|
||||
public class PrimaryWidgetConfiguration :
|
||||
List<IPrimaryCommand>
|
||||
List<IPrimaryCommandConfiguration>
|
||||
{
|
||||
}
|
||||
+2
-2
@@ -3,8 +3,8 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Hyperbar.Windows.Primary;
|
||||
|
||||
public class PrimaryWidgetBuilder :
|
||||
IWidgetBuilder
|
||||
public class PrimaryWidgetProvider :
|
||||
IWidgetProvider
|
||||
{
|
||||
public void Create(IServiceCollection services) => services.AddConfiguration<PrimaryWidgetConfiguration>()
|
||||
.AddWidgetTemplate<PrimaryWidgetViewModel>();
|
||||
@@ -4,15 +4,13 @@ public class PrimaryWidgetViewModel :
|
||||
WidgetViewModelBase
|
||||
{
|
||||
public PrimaryWidgetViewModel(ITemplateFactory templateFactory,
|
||||
IServiceFactory serviceFactory) : base(templateFactory, serviceFactory)
|
||||
IServiceFactory serviceFactory,
|
||||
IMediator mediator) : base(templateFactory, serviceFactory)
|
||||
{
|
||||
;
|
||||
Add<WidgetButtonViewModel>("Start", new Action(() => mediator.Send(new KeyAcceleratorCommand(VirtualKey.LeftWindows))));
|
||||
|
||||
Add<WidgetButtonViewModel>("test 1", new Action(() =>
|
||||
{
|
||||
}));
|
||||
Add<WidgetButtonViewModel>("test 2", new Action(() => { }));
|
||||
Add<WidgetButtonViewModel>("test 4", new Action(() => { }));
|
||||
Add<WidgetButtonViewModel>("test 5", new Action(() => { }));
|
||||
//Add<WidgetButtonViewModel>("test 2", new Action(() => { }));
|
||||
//Add<WidgetButtonViewModel>("test 4", new Action(() => { }));
|
||||
//Add<WidgetButtonViewModel>("test 5", new Action(() => { }));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user