Example of binding a click event for a button?

Feb 24, 2015 at 7:57 PM
Edited Feb 24, 2015 at 7:58 PM
I am trying to use "ConvertTo-DataTemplate" to bind the click event for a button but every variation of "Click", "OnClick", "On_Click" etc. in the -Binding hash just causes ShowUI to die immediately. Is there any way of binding a scriptblock to the onclick event for a button in a datatemplate with ShowUI? I am just trying to make a list of buttons clickable so that they open IE and a different web page per button.
Coordinator
Apr 11, 2015 at 7:59 AM
Edited Apr 11, 2015 at 8:14 AM
You don't bind events in a data template -- you need to bind them on the actual button.
Button "Bing" -On_Click { invoke-Item "http://bing.com" }