From 9b46ec1a123a6e19313924130ac9171a7dc43077 Mon Sep 17 00:00:00 2001 From: Marterich Date: Sun, 19 May 2024 14:46:14 +0200 Subject: [PATCH] Extract WPFNamecreation to function, fix hide all if none match --- functions/private/Get-TabXaml.ps1 | 7 +++++-- functions/private/Get-WPFObjectName.ps1 | 27 +++++++++++++++++++++++++ scripts/main.ps1 | 14 +++++++------ 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 functions/private/Get-WPFObjectName.ps1 diff --git a/functions/private/Get-TabXaml.ps1 b/functions/private/Get-TabXaml.ps1 index bda4d836..b70363c1 100644 --- a/functions/private/Get-TabXaml.ps1 +++ b/functions/private/Get-TabXaml.ps1 @@ -77,9 +77,12 @@ function Get-TabXaml { $panelcount++ } } + + # Dot-source the Get-WPFObjectName function + . .\functions\private\Get-WPFObjectName + $categorycontent = $($category -replace '^.__', '') - # Remove all special Characters from the name because it will later be used as a Powershell Variable - $categoryname = "WPFLabel"+$($categorycontent -replace '[^a-zA-Z0-9]','') + $categoryname = Get-WPFObjectName -type "Label" -name $categorycontent $blockXml += "