//2D
        private void RotateUIElement(string itemId)
        {
            Console.WriteLine("MainWindow: Rotate called.");
            ClientServerUtil csu = ClientServerUtil.getInstance();
            position         p   = csu.getPosition(itemId);

            if (p != null)
            {
                int      angle = getAngleFromDirection(p.direction);
                GridItem it    = GetItemFromID(itemId);
                // Invoke ChangeTextBox with 1 parameter (TextForTextBox)
                GridC.Dispatcher.BeginInvoke(new SetAngleDelegate(it.set_angle), new object[] { angle });
            }
        }
        //2D
        private void MoveUIElement(string itemId)
        {
            ClientServerUtil csu = ClientServerUtil.getInstance();
            position         p   = csu.getPosition(itemId);

            if (p != null)
            {
                GridItem it = GetItemFromID(itemId);
                // Invoke ChangeTextBox with 1 parameter (TextForTextBox)
                GridC.Dispatcher.BeginInvoke(new MoveUIElementDelegate(GridC.moveItem), new object[] { it, p.x, p.y });
                #if DEBUG
                Console.WriteLine("MoveUIElement: x = " + p.x + " und y = " + p.y);
                #endif
            }
        }
        private void CreateSimulationElement(string itemId)
        {
            ClientServerUtil csu = ClientServerUtil.getInstance();
            position         p   = csu.getPosition(itemId);

            if (p != null)
            {
                ToolboxItem toolboxItem = toolbox.Dispatcher.Invoke(new GetItemForIdDelegate(toolbox.getItemForId), new object[] { getClassIdFromItemId(itemId) }) as ToolboxItem;
                //TextBox it = GridC.Dispatcher.Invoke(new GetGridItemDelegate(GridC.getGridItem), new object[] {  }) as GridItem;
                //it.instanceId = itemId;
                //GridC.Dispatcher.BeginInvoke(new CreateSimulationElementDelegate(GridC.placeItem), new object[] { it, p.x, p.y });
                #if DEBUG
                Console.WriteLine("CreateSimulationElement: new TextBox created at x = " + p.x + " y = " + p.y);
                #endif
            }
        }