Display issue with WPF toolkit Color Picker inside toolbar

為{幸葍}努か 提交于 2019-12-25 01:34:30

问题


Following XAML in WPF is displaying the dropdown button of the WPF Toolkit's Color Picker outside the toolbar as shown in the screenshot below.

Question: How can I make the dropdown button display inside the toolbar (something similar to what we have in MS WORD toolbar's color picker)? Obviously, I'm missing something in the XAML below.

Screenshot of the Toolbar with Color Picker:

<DockPanel Margin="0,0,660,0">
<ToolBarTray>
    <ToolBar>
        <Button Command="New" Content="New" />
        <Button Command="Open" Content="Open" />
        <ToggleButton x:Name="tb" Content="Color" />
        <Popup IsOpen="{Binding IsChecked, ElementName=tb}"
                       PlacementTarget="{Binding ElementName=tb}"
                       Placement="Bottom"
                       StaysOpen="False">
            <xctk:ColorPicker Name="ColorPicker1" 
                              AdvancedButtonHeader="Advanced"
                              DisplayColorAndName="True" />
        </Popup>
    </ToolBar>
</ToolBarTray>
</DockPanel>

EDIT: Added DockPanel tag in the XAML - in case that is making any difference

来源:https://stackoverflow.com/questions/55764295/display-issue-with-wpf-toolkit-color-picker-inside-toolbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!