更新时间:2023-11-03 16:49:58
考虑到 WPF 和 PowerShell,请查看 WPF Linkcollection for PowerShell 来自 Bernd.您会发现许多对您有所帮助的有趣链接.
Considering WPF and PowerShell, have a look at WPF Linkcollection for PowerShell from Bernd. You will find many interesting links that will help you.
考虑到您的问题,只需使用模式
Considering your problem, just use pattern
$control.Add_<someevent>({ what to do })
例如,someevent
可以是 点击
按钮:
For example, someevent
could be Click
for a Button:
$button.Add_Click({ $global:clicked = $true })
您传入处理事件的脚本块.
You pass in a scriptblock that handles the event.