void menuModule_menuItemClick(object sender, MenuItemClickEventArgs e) { switch (e.MenuName) { case "Rect": { //create rect from spec dzBoardModule.AddNewRect(0, 0, 50, 50); } break; case "Box": { dzBoardModule.AddNewBox(20, 20, 50, 50); } break; case "Text": { } break; case "Image": { //load image //Image img = viewport.P.CreatePlatformBitmap( //dzBoardModule.AddNewImageBox(20, 20, 100, 50); ImageBinder imgBinder = LoadImage("../../Demo/favorites32.png"); var holder = dzBoardModule.AddNewImageBox(20, 20, 50, 50, imgBinder); holder.SetSerializeDelegate(SerializeDzImageBox); holder.SetCloneDelegate(CloneImageBox); } break; } }