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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:05:47+00:00 2026-05-14T14:05:47+00:00

I have a WPF UserControl. The code behind file declares some RoutedUICommand objects which

  • 0

I have a WPF UserControl. The code behind file declares some RoutedUICommand objects which are referenced in the XAML. The application builds and runs just fine. However Expression Blend 3 cannot load the XAML in the designer and gives errors like this one:

The member “ResetCameraCommand” is not
recognized or accessible.

The class and the member are both public. Building and rebuilding the project in Blend and restarting Blend hasn’t helped. Any ideas what the problem is?

Here are fragments of my XAML …

<UserControl x:Class="CAP.Visual.CameraAndLightingControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CAP.Visual;assembly=VisualApp"
Height="100" Width="700">   
    <UserControl.CommandBindings>
        <CommandBinding Command="local:CameraAndLightingControl.ResetCameraCommand" Executed="ResetCamera_Executed" CanExecute="ResetCamera_CanExecute"/>
    </UserControl.CommandBindings>
    ....

… and the code behind C#

namespace CAP.Visual
{
    public partial class CameraAndLightingControl : UserControl
    {
        public readonly static RoutedUICommand ResetCameraCommand;

        static CameraAndLightingControl()
        {
            ResetCameraCommand = new RoutedUICommand("Reset Camera", "ResetCamera", typeof(CameraAndLightingControl));
        }
  • 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-14T14:05:47+00:00Added an answer on May 14, 2026 at 2:05 pm

    Expression Blend does NOT load the code-behind. It actually just loads the XAML. You can always create the Command objects in your UserControl.Resources in XAML. If you create something in code-behind and your XAML references it, Expression Blend won’t be able to find it since it just parses XAML.

    Before you go saying Blend is broken, this is by design. Commands and similar items should be encapsulated in your design/layout logic which should be in your XAML. If you have custom Commands or custom actions, it’s still pretty easy to make them available in your XAML.

    Here’s how I did it for my app:

    I have a C# class file called Command.cs in the MyApp.Commands namespace

    public static class AppCommands
    {
        public static RoutedCommand SendData { get { return _sendDataCommand; } }
    
        private static RoutedCommand _sendDataCommand = new RoutedCommand
        (
            "Send Data",
            typeof(AppCommands),
            new InputGestureCollection()
            {
                new KeyGesture(Key.N, ModifierKeys.Alt)
            }
        )
    }
    

    Then your XAML would include…

    <UserControl x:Class="MyApp.Window"
        xmlns:c="clr-namespace:TBL.SFDC.Commands">
        <UserControl.Resources>
            <CommandBinding Command="c:AppCommands.SendData" Executed="SendData_Executed" CanExecute="SendData_CanExecute" />
        <UserControl.Resources>
    </UserControl>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 468k
  • Answers 468k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You will either need to use a Server Side Include… May 16, 2026 at 2:16 am
  • Editorial Team
    Editorial Team added an answer You can show a list of the keys in the… May 16, 2026 at 2:16 am
  • Editorial Team
    Editorial Team added an answer You can use the preprocessor "stringify" # to do what… May 16, 2026 at 2:16 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.