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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:42:38+00:00 2026-05-26T04:42:38+00:00

Day 2 and I don’t have a clue. [.Net 3.5, VS 2008] I have

  • 0

Day 2 and I don’t have a clue. [.Net 3.5, VS 2008]

I have a UserControl that defines a ClickEvent:

public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent (
  "Click", RoutingStrategy.Bubble, typeof ( RoutedEventHandler ), typeof ( TouchToggleButton ) );

and an OnClick method:

protected virtual void OnClick ( )
{
    RaiseEvent ( new RoutedEventArgs { RoutedEvent = ClickEvent, Source = this } );
}

In each of two different windows, I wire an instance of this control to an event handler.

<wft:TouchToggleButton DockPanel.Dock="Top" x:Name="measurableButton" Click="measurableButton_Click">Cannot Measure</wft:TouchToggleButton>

and

<wft:TouchToggleButton x:FieldModifier="public" x:Name="BuyoutButton" Click="BuyoutButton_Click">Buyout</wft:TouchToggleButton>

and, finally, I have the two handlers defined:

private void measurableButton_Click ( object sender, RoutedEventArgs e )
{
    IsMeasurable = !IsMeasurable;
    OnMeasurableButtonChanged ( );
}

and

private void BuyoutButton_Click ( object sender, RoutedEventArgs e )
{
    IsBuyout = !IsBuyout;
    OnBuyoutButtonChanged ( );
}

In both cases, if I put a breakpoint at the OnClick, it hits. In the case of the measurableButton, the RaiseEvent goes to measurableButton_Click; in the case of the BuyoutButton, the RaiseEvent does NOT go to BuyoutButton_Click.

There is nowhere in the app an unwiring (-=) of the BuyoutButton.Click. What further could I check to discover the reason for the difference in these behaviors?

  • 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-26T04:42:39+00:00Added an answer on May 26, 2026 at 4:42 am

    With thanks to Rachel for making me think about the event, I realized I had left out

    public event RoutedEventHandler Click
    {
        add { AddHandler ( ClickEvent, value ); }
        remove { RemoveHandler ( ClickEvent, value ); }
    }
    

    in my inherited class. (Being an event, it does not inherit.) This fixed my problem, although I still wonder how it ever worked in the first place.

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

Sidebar

Related Questions

Good day, I have a class that implements the LoaderCallbacks, and hence have the
Good day I have a custom TextBox that has a IndicatorTextBox.ui.xml file as well
I'm programming to a microprocessor (Coldfire) and I don't have access every day to
I have one customer experiencing 5+ deadlocks per day. 170+ other customers don't get
When I learned C, teacher told me all day long: Don't use goto, that's
Okay, I have read about regex all day now, and still don't understand it
In Excel, i have sheets named after the working day. So, I don't have
Good day everyone, I'm new in C programming and I don't have a lot
Good day, i have a slight issue with relative layouts and i don't know
I don't want to have the day in the URL for a detail view

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.