protected virtual Option <MenuItem> CreateItemControl(IMenuModel item, int index, Node parent) { Ensure.That(item, nameof(item)).IsNotNull(); Ensure.That(parent, nameof(parent)).IsNotNull(); var node = ItemScene.Instance(); ItemsContainer.AddChild(node); var control = node.FindComponent <MenuItem>(); control.Match( c => { var shortcut = (index + 1).ToString().Head(); c.Model = Some(item); c.Shortcut = Some(shortcut); }, () => Logger.LogWarning("Failed to create menu item instance.") ); return(control); }