1
0
mirror of synced 2025-01-19 09:17:30 +01:00

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 public bool HighlightSelectedTab
{ {
get { get {
if (Renderer == null) if (Renderer == null || !(Renderer is MenuRenderer))
return false; return false;
return ((MenuRenderer)this.Renderer).HighlightMenuBar; return ((MenuRenderer)this.Renderer).HighlightMenuBar;
} }
set { set {
if (Renderer != null) if (Renderer == null || !(Renderer is MenuRenderer))
((MenuRenderer)this.Renderer).HighlightMenuBar = value; ((MenuRenderer)this.Renderer).HighlightMenuBar = value;
} }
} }

View File

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