public void add(ICreateATool tool_factory) { var button = new Button { Content = tool_factory.label }; button.Click += (s, e) => current_tool_factory = tool_factory; tool_bar.Children.Add(button); }