public void ShowElements()
        {
            ActionControl actC;
            int           x  = 0;
            int           X0 = 10;
            int           Y0 = 10;

            foreach (var act in layer.Actions)
            {
                x++;

                actC = new ActionControl
                {
                    Name        = "act" + x.ToString(),
                    DataContext = act,
                    Margin      = new Thickness(X0, Y0, 0, 0)
                };
                actC.MouseDown += Control_MouseDown;
                actC.MouseUp   += Control_MouseUp;
                Y0             += 250;
                actionControls.Add(actC);
            }
            X0            = 200;
            Y0            = 10;
            eventControls = new List <EventControl>();
            foreach (var action in layer.Actions)
            {
                foreach (var eventOrigin in layer.EventOrigins)
                {
                    Event        eEvent       = new Event();
                    EventControl eventControl = new EventControl();
                    eventControl.MouseDown  += Control_MouseDown;
                    eventControl.MouseUp    += Control_MouseUp;
                    eEvent.ParentAction      = action;
                    eEvent.EventOrigin       = eventOrigin;
                    eventControl.DataContext = eEvent;
                    eventControl.Margin      = new Thickness(X0, Y0, 0, 0);
                    layer.Events.Add(eEvent);
                    action.ChildEvents.Add(eEvent);
                    eventControls.Add(eventControl);
                    Y0 += 200;
                }
            }
            Addlines();
            AddeventsControl();
            AddactionControl();
        }
        public void ShowElements()
        {
            ActionControl actC;
            int x = 0;
            int X0 = 10;
            int Y0 = 10;
            foreach (var act in layer.Actions)
            {
                x++;

                actC = new ActionControl
                {
                    Name = "act" + x.ToString(),
                    DataContext = act,
                    Margin = new Thickness(X0, Y0, 0, 0)
                };
                actC.MouseDown += Control_MouseDown;
                actC.MouseUp += Control_MouseUp;
                Y0 += 250;
                actionControls.Add(actC);
            }
            X0 = 200;
            Y0 = 10;
            eventControls = new List<EventControl>();
            foreach (var action in layer.Actions)
                foreach (var eventOrigin in layer.EventOrigins)
                {
                    Event eEvent = new Event();
                    EventControl eventControl = new EventControl();
                    eventControl.MouseDown += Control_MouseDown;
                    eventControl.MouseUp += Control_MouseUp;
                    eEvent.ParentAction = action;
                    eEvent.EventOrigin = eventOrigin;
                    eventControl.DataContext = eEvent;
                    eventControl.Margin = new Thickness(X0, Y0, 0, 0);
                    layer.Events.Add(eEvent);
                    action.ChildEvents.Add(eEvent);
                    eventControls.Add(eventControl);
                    Y0 += 200;
                }
            Addlines();
            AddeventsControl();
            AddactionControl();
        }