我有三个 WPF 工具栏在一个工具栏容器中,我想让其中两个在左边,而另一个则浮动在右边。
<ToolBarTray DockPanel.Dock="Top">
<ToolBar>
<ComboBox/>
</ToolBar>
<ToolBar>
<Button/>
<Button/>
<Button/>
</ToolBar>
<ToolBar HorizontalAlignment="Right">
<Button/>
<Button/>
<Button/>
</ToolBar>
</ToolBarTray>
我曾经试图以编程的方式设置最右边工具栏的边距,但感觉很不正规。在运行时,可以在托盘中移动工具栏,所以我觉得我可能忽略了一些明显的东西。
也许我应该使用不同的控件?