diff --git a/functions/private/Initialize-AppStackPanel.ps1 b/functions/private/Initialize-InstallAppsMainElement.ps1 similarity index 83% rename from functions/private/Initialize-AppStackPanel.ps1 rename to functions/private/Initialize-InstallAppsMainElement.ps1 index 0e2dd313..38b425c8 100644 --- a/functions/private/Initialize-AppStackPanel.ps1 +++ b/functions/private/Initialize-InstallAppsMainElement.ps1 @@ -1,4 +1,4 @@ -function Initialize-AppStackPanel { +function Initialize-InstallAppsMainElement { <# .SYNOPSIS Clears the given WPF Grid and creates a [Windows.Controls.Border] containing a [Windows.Controls.StackPanel] @@ -18,9 +18,11 @@ function Initialize-AppStackPanel { $Border = New-Object Windows.Controls.Border $Border.VerticalAlignment = "Stretch" $Border.SetResourceReference([Windows.Controls.Control]::StyleProperty, "BorderStyle") - $StackPanel = New-Object Windows.Controls.StackPanel - $Border.Child = $StackPanel + + $dockPanel = New-Object Windows.Controls.DockPanel + $Border.Child = $dockPanel + $null = $targetGrid.Children.Add($Border) - return $StackPanel + return $dockPanel } \ No newline at end of file diff --git a/functions/private/Initialize-InstallHeader.ps1 b/functions/private/Initialize-InstallHeader.ps1 index 9a37f24b..1ea1d7fc 100644 --- a/functions/private/Initialize-InstallHeader.ps1 +++ b/functions/private/Initialize-InstallHeader.ps1 @@ -7,9 +7,6 @@ function Initialize-InstallHeader { The Parent Element into which the Header should be placed #> param($TargetElement) - $dockPanel = New-Object Windows.Controls.DockPanel - $TargetElement.Children.Add($dockPanel) - function New-WPFButton { param ( [string]$Name, @@ -88,5 +85,5 @@ function Initialize-InstallHeader { $sync.$($selectedAppsButton.Name) = $selectedAppsButton [Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top) - $null = $dockPanel.Children.Add($wrapPanelTop) + $null = $TargetElement.Children.Add($wrapPanelTop) } \ No newline at end of file diff --git a/functions/public/Invoke-WPFUIApps.ps1 b/functions/public/Invoke-WPFUIApps.ps1 index aad96145..e3d53929 100644 --- a/functions/public/Invoke-WPFUIApps.ps1 +++ b/functions/public/Invoke-WPFUIApps.ps1 @@ -9,9 +9,9 @@ function Invoke-WPFUIApps { switch ($TargetGridName) { "appspanel" { - $mainStackPanel = Initialize-AppStackPanel -TargetGridName $TargetGridName - $null = Initialize-InstallHeader -TargetElement $mainStackPanel - $sync.ItemsControl = Initialize-InstallAppArea -TargetElement $mainStackPanel + $dockPanel = Initialize-InstallAppsMainElement -TargetGridName $TargetGridName + $null = Initialize-InstallHeader -TargetElement $dockPanel + $sync.ItemsControl = Initialize-InstallAppArea -TargetElement $dockPanel Initialize-InstallCategoryAppList -TargetElement $sync.ItemsControl -Apps $Apps } default {