From 2bef1ef7fb1d5cd57e2af3f47a648e512cfcd4f2 Mon Sep 17 00:00:00 2001 From: Roy Date: Mon, 12 Feb 2018 09:40:08 +0200 Subject: Implemented motor group. --- Software/Visual_Studio/Tango.Editors/ElementsEditor.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.Editors') 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); -- cgit v1.3.1