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
@ -31,6 +31,10 @@ function Invoke-WPFUIElements {
|
|||||||
$borderstyle = $window.FindResource("BorderStyle")
|
$borderstyle = $window.FindResource("BorderStyle")
|
||||||
$HoverTextBlockStyle = $window.FindResource("HoverTextBlockStyle")
|
$HoverTextBlockStyle = $window.FindResource("HoverTextBlockStyle")
|
||||||
$ColorfulToggleSwitchStyle = $window.FindResource("ColorfulToggleSwitchStyle")
|
$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)
|
$targetGrid = $window.FindName($targetGridName)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user