Once the project gets created, follow these steps to add a toolbar in the application window:
- Open the MainWindow.xaml page from the Solution Explorer.
- Now, replace the existing Grid with a DockPanel so that we can host the toolbar docking to the top of the window.
- Add a ToolBarTray element inside the DockPanel and dock it to Top.
- Add a ToolBar control inside the ToolBarTray and then add a few buttons inside it, as shown in the following XAML markup:
<ToolBarTray DockPanel.Dock="Top"> <ToolBar> <Button Content="B" FontWeight="Bold" Width="20" Click="OnBoldButtonClicked"/> <Button Content="I" FontStyle="Italic" Width="20"/> <Button Width="20"> <TextBlock Text="U" TextDecorations="Underline"/> <...