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

  • Home
  • SEARCH
  • 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 9147465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:59:41+00:00 2026-06-17T10:59:41+00:00

I want to execute a delete command like this: ApplicationCommands.Delete.Execute(Keyboard.FocusedElement, Keyboard.FocusedElement); But: ApplicationCommands.Delete.CanExecute(Keyboard.FocusedElement, Keyboard.FocusedElement)

  • 0

I want to execute a delete command like this:

ApplicationCommands.Delete.Execute(Keyboard.FocusedElement, Keyboard.FocusedElement);

But:

ApplicationCommands.Delete.CanExecute(Keyboard.FocusedElement, Keyboard.FocusedElement)

is false, so it’s not executed.

How can I change it to be true?

  • 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-17T10:59:42+00:00Added an answer on June 17, 2026 at 10:59 am

    I believe you need to set up CommandBindings that specify what happens when the Execute and CanExecute functions are called.

    Here’s an example:

    <Window x:Class="Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
        <Window.CommandBindings>
            <CommandBinding Command="ApplicationCommands.Delete"
                            Executed="DeleteCommandHandler"
                            CanExecute="DeleteCanExecuteHandler" />
        </Window.CommandBindings>
        <StackPanel Name="MainStackPanel">
            <Button Command="ApplicationCommands.Delete" 
                    Content="Delete File" />
        </StackPanel>
    </Window>
    

    That example comes from the CommandBinding documentation (slightly modified).

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

Sidebar

Related Questions

I need to execute async delete operation with user confirmation. Something like this: public
I want to execute ANT delete target, so that I can delete all files
I want to execute a program which takes in 1 text file(say like Text.exe),
I want to execute a program in memory on Windows. I do not want
i want to execute some commands using NSIS script , but for the commands
I want to run some commands using the system() command, I do this way:
I'm using sed command to delete the first two line, but when I redirect
I want A computer to responsible for execute the command, and B computer will
I want to run a SELECT statement and I want execute a DELETE statement
I want to load a CSV file that looks like this: Acct. No.,1-15 Days,16-30

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.