mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
29 lines
928 B
PowerShell
29 lines
928 B
PowerShell
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
|
|
The WPF Grid name
|
|
.OUTPUTS
|
|
Returns the created [Windows.Controls.StackPanel] element
|
|
#>
|
|
param(
|
|
[Parameter(Mandatory)]
|
|
[string]$TargetGridName
|
|
)
|
|
$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")
|
|
|
|
$dockPanel = New-Object Windows.Controls.DockPanel
|
|
$Border.Child = $dockPanel
|
|
|
|
$null = $targetGrid.Children.Add($Border)
|
|
|
|
return $dockPanel
|
|
}
|