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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:56:00+00:00 2026-05-11T21:56:00+00:00

I’ve downloaded this AttachedCommandProject and ran it and it works well , enables me

  • 0

I’ve downloaded this AttachedCommandProject and ran it and it works well, enables me to e.g. put a MouseDown command on a Border element and handle that with a command in my ViewModel.

Now I would like to add this AttachedCommand functionality to my MVVM Visual Studio Template.

I copied all the necessary files into the my Commands folder of the MVVM project:

13.12.2008  21:00             7.445 BehaviorBinding.cs
05.12.2008  17:50             7.477 CommandBehavior.cs
13.12.2008  21:01             3.908 CommandBehaviorBinding.cs
13.12.2008  21:06             5.097 CommandBehaviorCollection.cs
04.12.2008  21:48             3.564 EventHandlerGenerator.cs
05.12.2008  17:52             2.376 ExecutionStrategy.cs
05.12.2008  17:52             2.067 SimpleCommand.cs

But when I try to use it with the same syntax as in the original project, I get the error The property ‘CommandBehavior.Event’ does not exist in XML namespace ‘clr-namespace:MvvmWithAttachedBehaviors.Commands’..

There are no other files to copy and no other references to add as far as I can see.

What could this error be trying to tell me? Has anyone gotten this AttachedCommandBehavior functionality to work in other projects?

<Window x:Class="MvvmWithAttachedBehaviors.Views.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="clr-namespace:MvvmWithAttachedBehaviors.Commands"
    Title="Main Window" Height="400" Width="800">
    <DockPanel>
        <StackPanel>
            <TextBlock Text="{Binding Output}"/>
            <Border Background="Yellow" Width="350" Margin="0,0,10,0" Height="35" CornerRadius="2"
                        c:CommandBehavior.Event="MouseDown" 
                        c:CommandBehavior.Command="{Binding SomeCommand}"
                        c:CommandBehavior.CommandParameter="This is the parameter sent."
                        >
                <TextBlock Text="MouseDown on this border to execute the command"/>
            </Border>
        </StackPanel>
    </DockPanel>
</Window>
  • 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-11T21:56:01+00:00Added an answer on May 11, 2026 at 9:56 pm

    Did the source files that contain CommandBehavior get copied into the new project? If so, I would check the namespace they are in. It could be that the namespace is different in this project. The line: { xmlns:c="clr-namespace:MvvmWithAttachedBehaviors.Commands" } is setting the prefix “c” to represent a namespace called MvvmWithAttachedBehaviors.Commands that exists in the local assembly. If this namespace is in a different assembly you will have to reference the assembly in this declaration.

    Have you tried rebuilding all? Sometimes the designer will give you xml namespace errors that clear up if you rebuild all.

    I hope this helps a little…

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Let me google that for you Full Snow Leopard support… May 12, 2026 at 2:33 pm
  • Editorial Team
    Editorial Team added an answer Ah ha, I just found out what was causing this.… May 12, 2026 at 2:33 pm
  • Editorial Team
    Editorial Team added an answer Although you don't specify this in your question, I assume… May 12, 2026 at 2:33 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS
I am currently running into a problem where an element is coming back from

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.