mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 17:30:37 -06:00
add error handling for styles
This commit is contained in:
parent
cbb5691982
commit
1c2b301613
@ -32,6 +32,10 @@ function Invoke-WPFUIElements {
|
||||
$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)
|
||||
|
||||
# Clear existing ColumnDefinitions and Children
|
||||
|
Loading…
Reference in New Issue
Block a user