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

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and

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.