mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-30 10:02:35 -05:00
add error handling for styles
This commit is contained in:
@ -31,6 +31,10 @@ function Invoke-WPFUIElements {
|
||||
$borderstyle = $window.FindResource("BorderStyle")
|
||||
$HoverTextBlockStyle = $window.FindResource("HoverTextBlockStyle")
|
||||
$ColorfulToggleSwitchStyle = $window.FindResource("ColorfulToggleSwitchStyle")
|
||||
|
||||
if (!$borderstyle -or !$HoverTextBlockStyle -or !$ColorfulToggleSwitchStyle) {
|
||||
throw "Failed to retrieve Styles using 'FindResource' from main window element."
|
||||
}
|
||||
|
||||
$targetGrid = $window.FindName($targetGridName)
|
||||
|
||||
|
Reference in New Issue
Block a user