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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:56:32+00:00 2026-06-13T23:56:32+00:00

I have a WPF application window with a set of three buttons (Button A,

  • 0

I have a WPF application window with a set of three buttons (Button A, B, C) and these buttons have command binding to respective View Model property.

When Button A is clicked it’s command executes (another application is launched, Button A is disabled as CommandCanExecute condition is updated to return false). This results in application window being deactivated.

Clicking Button B doesn’t execute it’s command but instead only activates the window and sets the focus to the Main window. 2nd click is required on Button B to execute its command.

The desired functionality is on click of Button B, while the application window is not active, the application window activates and command associated with Button B is executed. I have also tried removing the command and adding a click handler for test purpose but this displays same behaviour.

I appreciate any help with this issue.

  • 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-13T23:56:33+00:00Added an answer on June 13, 2026 at 11:56 pm

    Identified the problem to be related to how our Command binding is setup.

    Solution is to fire CanExecuteChanged event so that relevant CommandCanExecute is re-evaluated by the framework. I replaced our ICommand implementation with Prism DelegateCommand and invoked RaiseCanExecuteChanged() method of delegate command when the condition is changed.

    Before using Prism DelegateCommand, I tried calling CommandManager.InvalidateRequerySuggested() but it didn’t help in this case. I have not fully investigated why but we are already using PRISM in other applications so using DelegateCommand will suffice here.

    Many thanks

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

Sidebar

Related Questions

I have a WPF application, where Window property ResizeMode is set on NoResize .
I have a WPF Windows application. In one window there is a particular stackpanel
I have window form in my WPF Application when I open new window from
I have a C# application using WPF consisting of a single Window holding four
I have the following binding in my wpf application xaml: <TextBox Text={Binding Amount, StringFormat=c}
I am using Buttons in Wpf C# application. I have declared a style for
I have a WPF application with several windows. I would like to define GLOBAL
I have a WPF application that will always run on windows 7, it opens
I have a C# WPF application that I'd like to startup/display before the Windows
I have a fairly small solution that includes a WPF windows application. It builds

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.