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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:41:48+00:00 2026-05-23T12:41:48+00:00

My solutions compiles fine with no errors, but when I run my Silverlight project

  • 0

My solutions compiles fine with no errors, but when I run my Silverlight project I get this error: The attachable property ‘Command’ was not found in type ‘TextBoxKeyUp’. I have created behaviors in the past with success, and the code for this one is relatively trivial.

XAML Snippet:

        xmlns:prismCmd="clr-namespace:AGMGUI.Infrastructure.AttachedProperty;assembly=AGMGUI.Infrastructure"

            <TextBox Grid.Column="2" Text="{Binding InputFieldText, Mode=TwoWay}" 
                 TabIndex="1" Width="100" Height="24" HorizontalAlignment="Left" 
                 VerticalAlignment="Center" prismCmd:TextBoxKeyUp.Command="{Binding KeyUpCommand}"></TextBox>

Attached Property:

    public static class TextBoxKeyUp
{

    #region Command  attached property
    public static ICommand GetCommand(DependencyObject obj)
    {
        return (ICommand)obj.GetValue(CommandProperty);
    }

    public static void SetCommand(DependencyObject obj, ICommand value)
    {
        obj.SetValue(CommandProperty, value);
    }

    // Using a DependencyProperty as the backing store for Command.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty CommandProperty =
        DependencyProperty.RegisterAttached("Command", typeof(ICommand), typeof(TextBoxKeyUp), new PropertyMetadata(OnSetCommandCallback));

    private static void OnSetCommandCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
    {
        TextBox element = dependencyObject as TextBox;
        if (element != null)
        {
            TextBoxKeyUpBehavior behavior = GetOrCreateBehavior(element);
            behavior.Command = e.NewValue as ICommand;
        }
    }
    private static TextBoxKeyUpBehavior GetOrCreateBehavior(TextBox element)
    {
        TextBoxKeyUpBehavior behavior = element.GetValue(KeyUpBehaviorProperty) as TextBoxKeyUpBehavior;
        if (behavior == null)
        {
            behavior = new TextBoxKeyUpBehavior(element);
            element.SetValue(KeyUpBehaviorProperty, behavior);
        }
        return behavior;
    }
    #endregion

    #region KeyUpBehavior attached property
    public static TextBoxKeyUpBehavior GetKeyUpBehavior(DependencyObject obj)
    {
        return (TextBoxKeyUpBehavior)obj.GetValue(KeyUpBehaviorProperty);
    }

    public static void SetKeyUpBehavior(DependencyObject obj, TextBoxKeyUpBehavior value)
    {
        obj.SetValue(KeyUpBehaviorProperty, value);
    }

    public static readonly DependencyProperty KeyUpBehaviorProperty =
        DependencyProperty.RegisterAttached("KeyUpBehavior", typeof(TextBoxKeyUpBehavior), typeof(TextBoxKeyUp), null);
    #endregion

    #region CommandParameter attached property
    public static object GetCommandParameter(DependencyObject obj)
    {
        return (object)obj.GetValue(CommandParameterProperty);
    }

    public static void SetCommandParameter(DependencyObject obj, object value)
    {
        obj.SetValue(CommandParameterProperty, value);
    }

    public static readonly DependencyProperty CommandParameterProperty =
        DependencyProperty.RegisterAttached("CommandParameter", typeof(object), typeof(TextBoxKeyUp), new PropertyMetadata(OnSetCommandParameterCallback));

    private static void OnSetCommandParameterCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
    {
        TextBox element = dependencyObject as TextBox;
        if (element != null)
        {
            TextBoxKeyUpBehavior behavior = GetOrCreateBehavior(element);
            behavior.CommandParameter = e.NewValue;
        }
    }
    #endregion
}

Has anybody encountered this error before?

  • 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-23T12:41:48+00:00Added an answer on May 23, 2026 at 12:41 pm

    I found that my shell project did not contain a reference to the project where I had the AttachedProperty class. Once I added the reference, it worked like a charm.

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

Sidebar

Related Questions

This project compiles find when run under Linux, but fails when I try to
I have the following snippet, which compiles fine, but when I try to run
I have installation solution that have installer project (not web installer but simple installer)
I have written some code which compiles fine under linux but on Solaris I
This error seems to be posted all over the place but each one seems
The entire solution builds fine in Visual Studio, but when I run the Nant
I can compile the solution with no errors, but when I'll try to run
I have python script that works fine but only when run as stand-alone, while
I'm trying to recompile application, that compiles fine with warning level 4 in visual
I am getting the following error message when compiling or attempting to run my

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.