Last active
December 7, 2020 12:56
-
-
Save skclusive/502aa7c520fda357f293bd4789b07d91 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
using Skclusive.Core.Component; | |
using Skclusive.Material.Component; | |
using Skclusive.Material.Layout; | |
namespace Skclusive.Dashboard.App.View | |
{ | |
public class DashboardStyleProvider : StyleTypeProvider | |
{ | |
public DashboardStyleProvider() : base | |
( | |
priority: default, | |
typeof(ChartJsStyles), | |
typeof(DashboardStyles) | |
) | |
{ | |
} | |
} | |
public class DashboardScriptProvider : ScriptTypeProvider | |
{ | |
public DashboardScriptProvider() : base | |
( | |
priority: default, | |
typeof(MomentJsScript), | |
typeof(ChartJsScript), | |
typeof(ChartJsInteropScript) | |
) | |
{ | |
} | |
} | |
public static class DashboardViewExtension | |
{ | |
public static void TryAddDashboardViewServices(this IServiceCollection services, IDashboardViewConfig config) | |
{ | |
services.TryAddLayoutServices(config); | |
services.TryAddMaterialServices(config); | |
services.TryAddScoped<IDashboardViewConfig>(sp => config); | |
services.TryAddStyleTypeProvider<DashboardStyleProvider>(); | |
services.TryAddScriptTypeProvider<DashboardScriptProvider>(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment