aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Editors
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Editors')
-rw-r--r--Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs b/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs
index cf602cac7..abd5e5929 100644
--- a/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs
+++ b/Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs
@@ -446,7 +446,10 @@ namespace Tango.Editors
{
if (BringToFrontOnSelect)
{
- Canvas.SetZIndex(SelectedElement as UIElement, Elements.Max(x => Canvas.GetZIndex(x as UIElement) + 1));
+ if (Elements.Count > 0)
+ {
+ Canvas.SetZIndex(SelectedElement as UIElement, Elements.Max(x => Canvas.GetZIndex(x as UIElement) + 1));
+ }
}
SetElementSelection(SelectedElement, true);