Product: PowerShell Universal
Version: 2.1.1
Is there an easy way to change the colour of an icon on a button WITHOUT having the button as an endpoint?
I can achieve this with the code below, but this is nested in a UdDynamic, when i have a hundred or so of these on the screen they are seriously slow. There must be an easier option that i am just missing here. I would like to set-udelement with the button and change attributes, but the icon is a new-udicon in there, is this possible? seems such a waste of an endpoint!
New-UdDynamic -Id "Dynamic1" -Content {
if ($Session:var2 -eq "1")
{
$Colour = "green"
} else {
$Colour = "black"
}
New-UdButton -Icon (New-UdIcon -Color $Colour -Size 5x -Icon beer) -OnClick {
}
}
# Change Icon
New-UdButton -Text "Green" -OnClick {
$Session:var2 = "1"
Sync-UdElement -Id "Dynamic1"
}
New-UdButton -Text "Black" -OnClick {
$Session:var2 = "0"
Sync-UdElement -Id "Dynamic1"
}
I have tried all sorts, New-UdElement which dumps a load of HTML code where the icon was…
Thanks!