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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:21:23+00:00 2026-05-26T20:21:23+00:00

I began to use MVVM pattern yesterday.But for working with events i needed to

  • 0

I began to use MVVM pattern yesterday.But for working with events i needed to install MVVM light toolkit.I did that,and added library to references.At UserControl i announced that library,but when i want to use toolkit whatever i write it doesnt show any suggestions and doesnt accept what i want to write and shows this error “A value of type ‘EventToCommand’ cannot be added to a collection or dictionary of type ‘TriggerActionCollection’ “

<EventTrigger RoutedEvent="TextChanged">
   <mvvm:EventToCommand Command="{Binding Test}"/>
</EventTrigger>

`

  • 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-26T20:21:24+00:00Added an answer on May 26, 2026 at 8:21 pm

    You have to use it like this ..

    Namespace to add :
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <mvvm:EventToCommand Command="{Binding Path=UserControlLoadedCommand}" />
        </i:EventTrigger>
    </i:Interaction.Triggers> 
    

    Dont forget to add a reference to System.Windows.Interactivity to your project

    You need To Use PassEventArgsToCommand="True" in

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <mvvm:EventToCommand Command="{Binding Path=UserControlLoadedCommand}" PassEventArgsToCommand="True" />
        </i:EventTrigger>
    </i:Interaction.Triggers> 
    

    And then you can get that at ViewModel ….. you Might Need to use Generic RelayCommand as

    RelayCommand<KeyEventArgs> myCommand= new RelayCommand<KeyEventArgs>(Execute,CanExecute)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of the FTP accounts that I use recently began requiring secure FTP connections,
I recently began using BIRT and have developed a report to use with my
I use do auto indenting follow lines that begin with python keywords in Vim
I just began studying WCF because i need it for a school assignment. But
I'm working on a project where I have some hierarchical data that I want
I have used 4 images and use touches began method to detect user's touch
I'm wanting to use an ORM tool for an asp.net web app I'm working
As my experience with .Net really began as working on existing in-house applications for
I've recently begun to realize that the use of the extern keyword is highly
First I'm not mad, because I use MVVM in WinForms-) I know about MVP

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.