public void InitNavBar() { if (this.Parent != null) { this.Parent.SizeChanged += ParentSizeChanged; } int i = 0; foreach (var menu in CaptionTexts_) { IconGroup group = new IconGroup(menu.Key, this.Size.Width); group.OnIconButtonClick += OnItemClick; group.GroupIndex = ++i; group.OrderId = menu.Value; group.OnCaptionButtionClick += GroupCaptionButtonClick; this.Groups.Add(group); } }