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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:57:52+00:00 2026-05-23T18:57:52+00:00

I have a popup in a custom control that popups with a mouseenter event.

  • 0

I have a popup in a custom control that popups with a mouseenter event.
The popup and button display fine.
When I click on the button, the control freezes and does not fire the command. To unfreeze, I have to minimize the window.

The popup code is as follows:

<Popup Name="Popup_PrevButton"
       PlacementTarget="{Binding ElementName=PART_Button}"
       Placement="Left" 
       StaysOpen="False"
       AllowsTransparency="True" 
       PopupAnimation="Fade"
       Focusable="True">
     <Grid>
           <Button
           Name="Button_PrevButton"
           Margin="2,0,2,0" 
           Width="20" 
           Height="48"
           BorderBrush="{TemplateBinding BorderBrush}" 
           BorderThickness="{TemplateBinding BorderThickness}" 
           Foreground="{TemplateBinding Foreground}"
           Command="{Binding Path=Button_NextButton}">
           </Button>
      </Grid>
</Popup>

If I use a Click=Button_NextButton I get in an error that states:
Failed to create a ‘Click’ from the text ‘Button_NextButton’.

Update

I have updated my code and implemented the RelayCommand class as suggested. I changed the binding to

Command="{Binding Path=nCommand:CustomCommands.Button_Click}">

I am confident that i have bound the command (By changing things I break the program so it won’t run – e.g.: if i remove the sub, then i get an error that the sub doesn’t exist), but when i click on the button, and the same thing happens.

The button command is as follows:

Private Sub ON_Button_Click(ByVal sender As Object, ByVal e As ExecutedRoutedEventArgs)
    'Do something here
End Sub

Code for nCommand:
Public Shared Button_PrevButton_Click As New RoutedCommand(“Button_PrevButton_Click”, GetType(MainWindow))

Binding in MainWindow:

So basically i know the compiler is seeing things, but when i actually click it doesn’t pass it to the sub. any further thoughts?

  • 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-23T18:57:53+00:00Added an answer on May 23, 2026 at 6:57 pm

    The button’s Command property should be bound to something on the object set as the DataContext which implements the ICommand interface (as H.B. mentioned).

    An easy way to achieve this is to use a wrapper class which contains much of the mechanics of the ICommand implementation. Here’s a link to a good introductory article on MVVM containing an implementation of the RelayCommand class which does this.

    The entire article is a great read, but you can skip down to the “Relaying Command Logic” section to see the implementation.

    Hope that helps!

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

Sidebar

Related Questions

I have a Popup control in WPF that loades it's content dynamically and each
I have a calendar control derived from DataGridView. A custom item hover event is
I need to create a custom control containing a combobox whose popup will have
I have a popup menu that displays dynamically created custom JPanel objects in a
Coming from this question , I have a wxComboCtrl with a custom popup made
I have created a custom TitleWindow whcih i use as a popup. The contents
I have a WPF application where I'd like to create a custom pop-up that
I have a popup search box that is shown when the user mouses over
I have a popup menu that has a few items in it. Option 1
I have a popup function in a program that works well, be re-loads the

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.