Try to fix potential cast issue if renderer does not apply on certain themes

This commit is contained in:
KillzXGaming 2019-10-15 17:56:56 -04:00
parent 0882c488c9
commit 1ff766a199
2 changed files with 4 additions and 4 deletions

View file

@ -37,13 +37,13 @@ namespace Toolbox.Library.Forms
public bool HighlightSelectedTab
{
get {
if (Renderer == null)
if (Renderer == null || !(Renderer is MenuRenderer))
return false;
return ((MenuRenderer)this.Renderer).HighlightMenuBar;
}
set {
if (Renderer != null)
if (Renderer == null || !(Renderer is MenuRenderer))
((MenuRenderer)this.Renderer).HighlightMenuBar = value;
}
}

View file

@ -33,14 +33,14 @@ namespace Toolbox.Library.Forms
{
get
{
if (Renderer == null)
if (Renderer == null || !(Renderer is MenuRenderer))
return false;
return ((MenuRenderer)this.Renderer).HighlightMenuBar;
}
set
{
if (Renderer != null)
if (Renderer != null || !(Renderer is MenuRenderer))
((MenuRenderer)this.Renderer).HighlightMenuBar = value;
}
}