wpf 工具栏错误:ToolBar.Overflowmode 在绑定场景中不起作用
这有效(将按钮放置在溢出区域):
<ToolBar>
<Button ToolBar.OverflowMode="Always">Hit me</Button>
</ToolBar>
这不起作用(不将按钮放置/保留在溢出区域):
<ToolBar Grid.Row="3" ItemsSource="{Binding Path=Groups[0].Items}"></ToolBar>
<DataTemplate DataType="{x:Type local:ItemViewModel}">
<Button ToolBar.OverflowMode="Always">Hit me</Button>
</DataTemplate>
有谁知道这个问题是否有解决方法?
This works (places the button in the overflow area):
<ToolBar>
<Button ToolBar.OverflowMode="Always">Hit me</Button>
</ToolBar>
This does not (does not place/keep the button in the overflow area):
<ToolBar Grid.Row="3" ItemsSource="{Binding Path=Groups[0].Items}"></ToolBar>
<DataTemplate DataType="{x:Type local:ItemViewModel}">
<Button ToolBar.OverflowMode="Always">Hit me</Button>
</DataTemplate>
Does anyone know if there is a workaround for this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一种将溢出应用于所有项目的方法,并使用自定义样式选择器,您可以定制溢出以仅引用与您相关的项目。
静态版本:
I found a way of applying overflow to all items, and using a custom style selector, you can probably tailor the overflow to only refer to the items relevant for you.
Static version: