mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-12-17 17:55:28 +00:00
25 lines
573 B
PowerShell
25 lines
573 B
PowerShell
|
|
function Invoke-WPFTab {
|
||
|
|
|
||
|
|
<#
|
||
|
|
|
||
|
|
.DESCRIPTION
|
||
|
|
Sole purpose of this fuction reduce duplicated code for switching between tabs.
|
||
|
|
|
||
|
|
#>
|
||
|
|
|
||
|
|
Param ($ClickedTab)
|
||
|
|
$Tabs = Get-Variable WPFTab?BT
|
||
|
|
$TabNav = Get-Variable WPFTabNav
|
||
|
|
$x = [int]($ClickedTab -replace "WPFTab","" -replace "BT","") - 1
|
||
|
|
|
||
|
|
0..($Tabs.Count -1 ) | ForEach-Object {
|
||
|
|
|
||
|
|
if ($x -eq $psitem){
|
||
|
|
$TabNav.value.Items[$psitem].IsSelected = $true
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
$TabNav.value.Items[$psitem].IsSelected = $false
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|