I have two ToggleButtons
. I want only one of them to be in the Pressed
state at any time. So let's say Model ToggleButton
is pressed:
I want to achieve the below concepts:
- If I press
Drawing ToggleButton
, theModel ToggleButton
will be unpressed andDrawing ToggleButton
will go to pressed state. - If press the
Model Button
which is in the pressed state nothing will happen.
By the way here is all I have done so far :(
<ToggleButton Width="50" Height="23" Margin="0 0 0 0">Model</ToggleButton>
<ToggleButton Width="50" Height="23" Margin="0 0 7 0">Drawing</ToggleButton>
Update:
Using the provided link under the comments, I came up with this:
<RadioButton Style="{StaticResource {x:Type ToggleButton}}" Content="Model" IsChecked="True" />
<RadioButton Style="{StaticResource {x:Type ToggleButton}}" Content="Drawing" />
Now the above code gives me two buttons, but how can I style these? I know how to style. But I don't know what to style here? I mean I have already filled the style property here how can I style the ToggleButton
itself?