winutil/functions/private/Initialize-InstallAppsMainElement.ps1

29 lines
928 B
PowerShell
Raw Normal View History

2024-10-29 15:51:07 -05:00
function Initialize-InstallAppsMainElement {
<#
.SYNOPSIS
Clears the given WPF Grid and creates a [Windows.Controls.Border] containing a [Windows.Controls.StackPanel]
Used to as part of the Install Tab UI generation
.PARAMETER TargetGridName
2024-11-02 07:51:48 -05:00
The WPF Grid name
.OUTPUTS
Returns the created [Windows.Controls.StackPanel] element
#>
param(
[Parameter(Mandatory)]
[string]$TargetGridName
)
2024-11-02 07:51:48 -05:00
$targetGrid = $sync.Form.FindName($TargetGridName)
$null = $targetGrid.Children.Clear()
$Border = New-Object Windows.Controls.Border
$Border.VerticalAlignment = "Stretch"
$Border.SetResourceReference([Windows.Controls.Control]::StyleProperty, "BorderStyle")
2024-10-29 15:51:07 -05:00
$dockPanel = New-Object Windows.Controls.DockPanel
$Border.Child = $dockPanel
$null = $targetGrid.Children.Add($Border)
2024-10-29 15:51:07 -05:00
return $dockPanel
2024-11-02 07:51:48 -05:00
}