Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6659893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:05:13+00:00 2026-05-26T02:05:13+00:00

I have the following code (only relevant snippets) <ribbon:RibbonWindow ………….> <Grid> <ribbon:Ribbon> <ribbon:RibbonToggleButton x:Name=Button2

  • 0

I have the following code (only relevant snippets)

<ribbon:RibbonWindow .............>
    <Grid>
        <ribbon:Ribbon>
            <ribbon:RibbonToggleButton 
                   x:Name="Button2"
                   SmallImageSource="Images\SmallIcon.png"
                   Label="Properties">
                   <ribbon:RibbonToggleButton.Triggers>
                       <Trigger Property="ToggleButton.IsChecked" Value="True">
                           <Setter TargetName="SPanel1" Property="UIElement.IsVisible" Value="False"/>
                           <Setter TargetName="SPanel2" Property="UIElement.IsVisible" Value="True"/>

                       </Trigger>
                   </ribbon:RibbonToggleButton.Triggers>

            </ribbon:RibbonToggleButton>


        </ribbon:Ribbon>
    </Grid>

</ribbon:RibbonWindow>

And when i run the application, it hangs up and te debugger pops up. What am i doing wrong?

I have tried setting the trigger on the grid, wrapping everything in a control template and setting a trigger there, same problem!

Edit

I have tried creating a button, and only the tag of trigger causes the Unhandled Exception error.

<Button Content="Button" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="12,27,0,0" Name="TestButton" VerticalAlignment="Top" Width="75" >
      <Button.Triggers>
           <Trigger></Trigger>
      </Button.Triggers>
</Button>

Edit 2

Using Data triggers makes the Unhandled Exception go away but the trigger is not responding:

 <StackPanel.Style>
                <Style TargetType="StackPanel">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=Button2, Path=ToggleButton.IsChecked}" Value="True">
                            <Setter Property="UIElement.Visibility" Value="Hidden"></Setter>
                        </DataTrigger>

                    </Style.Triggers>
                </Style>
            </StackPanel.Style>

Edit 3

<ribbon:RibbonToggleButton 
              x:Name="Button2"
              SmallImageSource="Images\SmallIcon.png"
              Label="Properties">

</ribbon:RibbonToggleButton>

And The panel to be hidden

<StackPanel                  
      Grid.Row="2"                   
      Grid.Column="1"                       
      x:Name="SPanel1"
      Visibility="Visible">                        
      <Label>*Deafult Grid*</Label>   
<StackPanel.Style>                           
     <Style TargetType="StackPanel">                               
          <Style.Triggers>                                   
              <DataTrigger Binding="{Binding ElementName=Button2, Path=ToggleButton.IsChecked}" Value="True">                                     
               <Setter Property="UIElement.Visibility" Value="Hidden"></Setter>                                                                
              </DataTrigger>                                
          </Style.Triggers>                            
     </Style>
                </StackPanel.Style>
</StackPanel>

And for second StackPanel that i want to show

<StackPanel 
     Grid.Row="2" 
     Grid.Column="1" 
     x:Name="SPanel2"
     Visibility="Hidden">
         <Label>*Panel 2 *</Label>
         <StackPanel.Style>
             <Style TargetType="StackPanel">
                 <Style.Triggers>
                     <DataTrigger Binding="{Binding ElementName=Button2, Path=IsChecked}" Value="True">
                     <Setter Property="UIElement.Visibility" Value="Visible"></Setter>
                     </DataTrigger>

                 </Style.Triggers>
             </Style>
         </StackPanel.Style>
 </StackPanel>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:05:14+00:00Added an answer on May 26, 2026 at 2:05 am

    You need to use DataTrigger, and set the style property of the two panels to the IsChecked propery of the checkbox, here an example

            <CheckBox Name="check" Content="Prova" IsChecked="True"> </CheckBox>
    
            <Canvas Name="SPanel1" Background="Blue" Width="100" Height="100">
                <Canvas.Style>
                    <Style TargetType="Canvas">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding ElementName=check, Path=IsChecked}" Value="True">
                                 <Setter Property="Visibility" Value="Hidden"></Setter>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Canvas.Style>
            </Canvas>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code (only relevant portions shown for sake of brevity - please
I have the following code in a shell script. This only seems to work
I have the following code which works fine. However, I only want to return
I have the following scenario. The client code only has access to FooHandler, not
I have written the following code. But it is removing only &nbsp; not <br>
How do I change the following bit of code so that I only have
Reviewing a quite old project I found the following curious code snippet (only relevant
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following Code Block Which I tried to optimize in the Optimized section
I have following code in my application: // to set tip - photo in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.