From a280ffa8df7b775d0f26f54d28451949aacbcc29 Mon Sep 17 00:00:00 2001 From: Alon Gvili <34351424+AlonGvili@users.noreply.github.com> Date: Fri, 16 Aug 2019 03:27:16 +0300 Subject: [PATCH] Add OnClick Parameter to New-UDCounter --- src/UniversalDashboard/Cmdlets/NewCounterCommand.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/UniversalDashboard/Cmdlets/NewCounterCommand.cs b/src/UniversalDashboard/Cmdlets/NewCounterCommand.cs index 93e81aa7..f66ce2c2 100644 --- a/src/UniversalDashboard/Cmdlets/NewCounterCommand.cs +++ b/src/UniversalDashboard/Cmdlets/NewCounterCommand.cs @@ -29,6 +29,10 @@ public class NewCounterCommand : CallbackCmdlet [Parameter()] public TextAlignment TextAlignment { get; set; } + + [Parameter()] + public ScriptBlock OnClick { get; set; } + protected override void EndProcessing() { var counter = new Counter @@ -36,6 +40,7 @@ protected override void EndProcessing() AutoRefresh = AutoRefresh, RefreshInterval = RefreshInterval, Callback = GenerateCallback(Id), + OnClick = GenerateCallback(Id + "onClick", OnClick, null), Format = Format, Icon = FontAwesomeIconsExtensions.GetIconName(Icon), Title = Title,