DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Are there any plans to make WPF controls available within the PSS forms designer?
WPF controls in PSS
Forum rules
Do not post any licensing information in this forum.
Do not post any licensing information in this forum.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: WPF controls in PSS
Not seamless, these are two incompatible technologies as far as the designer goes. WPF more or less requires you to write XAML, basically spelling everything out in XML.
You can use WPF controls with a Windows Form environment though. There is a control set "ElementHost – WPF Control Host" that you can add to your form to include WPF controls.
You can use WPF controls with a Windows Form environment though. There is a control set "ElementHost – WPF Control Host" that you can add to your form to include WPF controls.
- Attachments
-
- 2017-08-08_5-08-20.png (66.59 KiB) Viewed 8066 times
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alex.ferrie
- Posts: 7
- Last visit: Mon Jun 18, 2018 1:01 am
Re: WPF controls in PSS
Hi Alex, thanks for the quick response. How do I then get access to the WPF controls?
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: WPF controls in PSS
I will let the expert answer this. Folks will be in later during normal office hours.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Alex.ferrie
- Posts: 7
- Last visit: Mon Jun 18, 2018 1:01 am
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: WPF controls in PSS
Hmm, sorry, not sure what happened. The best person for this is out of office this week. I will make sure to send emails until he answers
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: WPF controls in PSS
In order to access the controls within your XAML, you have to query the control and assign it to a variable.
If you want PowerShell Studio to provide PrimalSense, I recommend casting the object before assigning the variable:
$wpfButton = [System.Windows.Controls.Button]$WPFControl.FindName("WPFButton")
You may need to reference the WPF assembly first:
For further GUI support, I recommend posting in the PowerShell GUIs forum:
viewforum.php?f=21
Code: Select all
$script:WPFControl = Update-ElementHost -Elementhost $elementhost -XAML $xaml
if($WPFControl)
{
$wpfButton = [System.Windows.Controls.Button]$WPFControl.FindName("WPFButton")
if($wpfButton)
{
$wpfButton.Add_Click({Write-Host "WPF Button was clicked"})
}
}
$wpfButton = [System.Windows.Controls.Button]$WPFControl.FindName("WPFButton")
You may need to reference the WPF assembly first:
If you have the latest service release, you can set a breakpoint after the variable is assigned and PowerShell Studio will use the session state to provide PrimalSense.Add-Type -AssemblyName PresentationFramework
For further GUI support, I recommend posting in the PowerShell GUIs forum:
viewforum.php?f=21
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.