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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:31:09+00:00 2026-05-15T03:31:09+00:00

I am having a custom canvas derived from Canvas . It contains few ApplicationCommands

  • 0

I am having a custom canvas derived from Canvas. It contains few ApplicationCommands like New/Open/Save etc. added like this –

this.CommandBindings.Add(new CommandBinding(ApplicationCommands.New, New_Executed, 
New_Enabled));

New_Enabled always returns true.

This control is used in a wpf project having a menu bar; New/Open/Save menu button’s are present in this menu bar with their Command set to respective ApplicationCommand like this –

<syncfusion:SimpleMenuButton
    x:Name="NewMenu"
    Icon="Images\New_Large.png"
    Label="New"
    IsEnabled="True"
    Command="{x:Static ApplicationCommands.New}"
    syncfusion:Ribbon.KeyTip="N">
</syncfusion:SimpleMenuButton>

Command works correctly when focus is present on Canvas but as soon as focus shifts to other control, New button gets disabled. I have tried setting CommandTarget to main window but that too doesn’t work.

Why this is happening and how can to make sure that New menu button will always be enabled?

  • 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-15T03:31:10+00:00Added an answer on May 15, 2026 at 3:31 am

    @repka – Thanks for your response; I had already tried using canvas name as CommandTarget but it doesn’t work; Buttons gets enabled only when focus is on canvas as soon as i Click on some other control in window they gets disabled. I also tried using IsFocusScope but same result. Thanks for the command name strings tip.

    I had to settle with this workaround, although I am not too happy with this –

        public WindowMain()
        {
            InitializeComponent();
    
            //Add commnad bindings
            //Need to do this to keep New/Open/Save/Run buttons always enabled
            //ToDo:[AJ] Look for better solution then this
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.New, this.TheCanvas.New_Executed, this.TheCanvas.New_Enabled));
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Open, this.TheCanvas.Open_Executed, this.TheCanvas.Open_Enabled));
            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Save, this.TheCanvas.Save_Executed, this.TheCanvas.Save_Enabled));
            this.CommandBindings.Add(new CommandBinding(RTDesignerCanvas.Run, this.TheCanvas.Run_Executed));
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm having a hard time understanding custom events and I keep getting this same
I'm having trouble with a custom tag:- org.apache.jasper.JasperException: /custom_tags.jsp(1,0) Unable to find setter method
I have a custom Jabber IM client and I'm having a problem with links.
I'm having problems with an SQL query used to display custom profile fields and
I'm having issues with my SQL Reporting Services reports. I'm using a custom font
H guys. I'm developing a custom component for SSIS. I'm having a problem when
Having a heckuva time with this one, though I feel I'm missing something obvious.
Having worked with Classic ASP for about 2 years now by creating a few
Having to upgrade a database schema makes installing a new release of software a
I need to draw text to a canvas (of a custom view), and need

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.