Click here to Skip to main content
15,071,928 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All.

I have a group in which I have placed 3 togglebutton,After I click one toggle button the other toggle buttons in the group should be disabled
<RibbonTab x:Name="tb" Header="T">
                <ribbon:RibbonGroup Name="Co" >
                    <ribbon:RibbonToggleButton Name="line" Label="Line" ></ribbon:RibbonToggleButton>
                    <ribbon:RibbonToggleButton Name="Polyline" Label="PolyLine" ></ribbon:RibbonToggleButton>



I know we can do this with click event and disable them,but was wondering if we can do this using triggers in xaml and wpf
When I click Ribbontogglebutton name "line" button "polyline" should be disabled

1 solution

You can use triggers for this, although if you do that, you will waste a lot of code space.

Instead, why don't you try finding a method that is called a lot, and check inside there, similar to this:

public void OftenCalledMethod(int bla1, int bla2)
toggleButton2.IsChecked = false;


And so forth. I know the example is in pseudo code, but it should be easy to convert.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900