Open pldmgg opened 7 years ago
The XAML designer does not produce a designer.ps1 file. The XAML is actually loaded at runtime and the code-behind is hooked to the controls in that manner. If you use bundling, it will encode the XAML as base64 and include it with the script but it's not exactly the same thing you're looking for.
What would you expect in the designer file?
I guess I was expecting the form controls to be exposed in PowerShell somehow. Something like the section "BEGIN/END Form Control Methods" section around line 467 in my NoClutter-NetworkMonitor.ps1 WPF App:
Or maybe they're already exposed by PoshToolsPro somehow? I just don't know how to reference them in my Script.ps1...
Ah. Yeah I see what you mean. Right now the controls are added to the code behind script when you wire up an event handler. I've had another user ask that all controls, regardless of whether they have an event handler, are available to the script.
Started a new PowerShell Script project in Visual Studio 2017. Then did Add New Item -> WPF Window (Beta). Pasted some XAML in there. The designer view GUI updated, but I couldn't find a file with corresponding code similar to how Form.Designer.ps1 auto-populated for a Windows Form project.
Is this functionality coming in the future?