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 500051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:02:52+00:00 2026-05-13T06:02:52+00:00

I have a ToggleButton that is malfunctioning. As I understand it, a ToggleButton should

  • 0

I have a ToggleButton that is malfunctioning. As I understand it, a ToggleButton should go checked when clicked then unchecked when clicked again.

The ToggleButton in this example does not. Clicking it just sets it to checked again. Any Ideas why?

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Grid>  
        <ToggleButton Width="100" Height="35"  Name="btnAddLinkComment" >           
             <CheckBox Content=" Comment" FlowDirection="RightToLeft" IsHitTestVisible="False" 
                       Focusable="False" IsChecked="{Binding ElementName=txtLinkComment,  Path=Text}" 
                       Name="chkHasComment" Margin="5"/>
        </ToggleButton>
        <Popup IsOpen="{Binding ElementName=btnAddLinkComment,Path=IsChecked}"  
               PlacementTarget="{Binding ElementName=btnAddLinkComment}"  Name="popAddCommentLink"
               AllowsTransparency="True" StaysOpen="False" PopupAnimation="Fade"  HorizontalOffset="-50"
               VerticalOffset="50">
            <Border BorderBrush="#FF000000" Background="LightBlue" BorderThickness="1,1,1,1" 
                    CornerRadius="8,8,8,8" Padding="5">
                <Grid Background="LightBlue">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80"></ColumnDefinition>
                        <ColumnDefinition Width="200"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock TextWrapping="Wrap" Foreground="Black">Enter Link Comment:</TextBlock>
                    <TextBox Grid.Column="1" Name="txtLinkComment" Width="200"></TextBox>
                </Grid>
            </Border>
        </Popup>
  </Grid>
</Page>
  • 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-13T06:02:52+00:00Added an answer on May 13, 2026 at 6:02 am

    I guess this happens due to popup being bent to the btnAddLinkComment.isChecked property. I believe what happens is that you’re clicking on the button when pop is shown which makes it to close and sets button’s IsChecked field to false which puts the button into untoggled state; then the click gets processed by the button itself and since it not toggled it becomes toggled and popup gets shown again. I guess you could resolve the issue by removing the binding and do some handling in code; smth like this:

    btnAddLinkComment.Click += btnAddLinkComment_Click;
    popAddCommentLink.Closed += popAddCommentLink_Closed;
    
    private void btnAddLinkComment_Click(object sender, RoutedEventArgs e)
    {
        if (popAddCommentLink.IsOpen && btnAddLinkComment.IsChecked == false)
            popAddCommentLink.IsOpen = false;
        else if (!popAddCommentLink.IsOpen && btnAddLinkComment.IsChecked == true)
            popAddCommentLink.IsOpen = true;
    }
    
    private void popAddCommentLink_Closed(object sender, EventArgs e)
    {
        btnAddLinkComment.IsChecked = false;
    }
    

    hope this helps, regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 418k
  • Answers 418k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You want access to the readline library, you can do… May 15, 2026 at 9:57 am
  • Editorial Team
    Editorial Team added an answer Stick your images into a SequenceFile; then you will be… May 15, 2026 at 9:57 am
  • Editorial Team
    Editorial Team added an answer It is possible this is a red herring from the… May 15, 2026 at 9:57 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.