wpfwpf-controlstoolbarcompare-contrast

What are the advantages of the WPF ToolBar?


I'm trying to decide whether I should create a simple StackPanel with Buttons on it, or whether I should use the WPF ToolBar class to contain these buttons (I am creating a simple toolbar).

What are the pros and cons to using WPF's built-in ToolBar control?

So far, these are the only advantages I have seen:

Are the any other benefits to the WPF ToolBar? Neither of these apply to my simple toolbar.


Solution

  • I would say use the Toolbar, because you never know when the next project will come along and need it. You also never know when this project may need it. I don't think there is any real drawback to using it over a StackPanel and the advantage you didn't mention is you'll have more experiance with a built in control for the next project.

    On the other hand, I don't see any harm in doing it with the StackPanel, only that if you need to extend functionallity in the future, you'll have to do some rework.