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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:24:14+00:00 2026-06-14T12:24:14+00:00

My ChildWindow has CloseButton and handler assigned to Click event. Code (only for example):

  • 0

My ChildWindow has CloseButton and handler assigned to Click event. Code (only for example):

Declaring close button:

<Button x:Name="CloseButton" Click="OnCloseButtonClick" />

Private counter (for diagnostics problem):

private uint _i;

Close event handler:

OnCloseButtonClick(object sender, RoutedEventArgs e)
{
     DialogResult = true;
     System.Diagnostics.Debug(_i++);
}

After fast clicking program can output “1”, “2”, “3”, and so on…
As i know after setting DialogResult = true(or false), ChildWindow should be closed and there should not be any way to raise the CloseButton’s Click event second time.

Can anyone help me to figure out cause of the problem and help to solve it without bool flags (executed/!executed)?

  • 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-06-14T12:24:15+00:00Added an answer on June 14, 2026 at 12:24 pm

    Copied from my comments

    The problem is because the close activates the close window animation to close the window which means the button events are available until the animation finishes and the window is closed, see During Silverlight ChildWindow closing animation user can click any button

    A quick and dirty solution is to add

    ((Button)sender).IsEnabled=false;
    

    To the beginning of you click handler function.

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

Sidebar

Related Questions

I have a silverlight 4 childwindow that has a textbox. When I click existing
I have a window which has 5 child windows. How can I close a
My app has a 'open file' button. Before launching the OpenFileDialog, it asks whether
I have a popup window like this, <controls:ChildWindow Background=Aquamarine> <RichTextBox> <Paragraph x:Name=WarningMessage > <Run>Test
I am reading from MSDN this: A child window has only one parent window,
I need to close child windows which has been loaded by a parent window.
When my silverlight application has loaded a silverlight childwindow pops up and require the
I have a form which has a button to launch a new form (to
I have a ChildWindow. In this childwindow, I have added properties that link to
Anyone got any neat solutions to prevent a Silverlight ChildWindow being moved? thanks, Mark

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.