tags:

views:

8

answers:

1

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 clicked it stays down (selected)?

+1  A: 

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" />
Athari