开发者

Down state in a toolbar button group

开发者 https://www.devze.com 2023-01-22 12:34 出处:网络
Consider the following xaml snippet: <ToolBarTray> <ToolBar Band=\"1\" BandIndex=\"1\"> <Button>Go</Button>

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

精彩评论

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

关注公众号