question

WalterBeach-2679 avatar image
0 Votes"
WalterBeach-2679 asked ·

WPF XML Powershell Events Templates

Hello,

I am having difficulty with how to add events to WPF XML in Powershell.

CheckStateChanged will say member not found and Checked says failed to create a 'Checked' from the text '...'

From what I can find most people find the control in Powershell using Findname and then do a Add_CheckStageChanged in Powershell with a scriptblock.

But the issue I am having is that when a Checkbox control is in a template I obviously can't find it.

So the work around is to do a findname on the datatemplate and then loadcontent of the datatemplate. Add an event to the checkbox pointing to a function. Then apply the template to my control.

But this seems like an ugly way of doing things. Is there an easier way to Add_<event> to a control within a template or groupstyle?

Any help would be appreciated.

windows-wpf
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers