Improve widget builder
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Hyperbar.Widget.Contextual;
|
||||
|
||||
public class ContextualWidgetBuilder :
|
||||
IWidgetBuilder
|
||||
{
|
||||
public void Create(IServiceCollection services) =>
|
||||
WidgetBuilder.Config(services, config =>
|
||||
{
|
||||
config.Id = Guid.Parse("d3030852-8d4a-4fbb-9aa5-96dff3dfa06c");
|
||||
config.Name = "Contextual commands";
|
||||
|
||||
services.AddWidgetTemplate<ContextualWidgetViewModel>();
|
||||
});
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Hyperbar.Widget.Contextual;
|
||||
|
||||
public class ContextualWidgetProvider :
|
||||
IWidgetProvider
|
||||
{
|
||||
public void Create(HostBuilderContext comtext, IServiceCollection services) => services
|
||||
.AddWidgetTemplate<ContextualWidgetViewModel>();
|
||||
}
|
||||
Reference in New Issue
Block a user