开发者

Down state in a toolbar button group

Consider the following xaml snippet:

    <ToolBarTray>
        <ToolBar Band="1" BandIndex="1">
            <Button>Go</Button>
            <Separator></Separator>
            <Button>Camera 1</Button>
            <Button>Camera 2</Button>
            <Button>Camera 3</Button>
        </ToolBar>

    </ToolBarTray>

How can I set the Camera 1 - 3 in a way that when one of them is clicke开发者_如何学编程d it stays down (selected)?


use RadioButtons with the same GroupName. If you want them to look like buttons, borrow style from ToggleButton.

<RadioButton Content="Camera 1" Style="{StaticResource {x:Type ToggleButton}}" GroupName="Camera" />
<RadioButton Content="Camera 2" Style="{StaticResource {x:Type ToggleButton}}" GroupName="Camera" />
<RadioButton Content="Camera 3" Style="{StaticResource {x:Type ToggleButton}}" GroupName="Camera" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜