private void CreateButton(ViewDefinition definition) { var button = CreateButton(); button.Name = definition.Name; button.Text = definition.TextName; button.ImageSrc = definition.ImageSrc; button.MouseUp += definition.RaiseButtonMouseUp; button.Init(_container); _panel.Children.Add(button); _buttons.Add(button); if (definition.HiddenMenu) { button.Visibility = Visibility.Collapsed; } }
protected void AddDefinition(ViewDefinition definition) { _owner.ViewDefinitions.Add(definition); CreateButton(definition); }