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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:10:28+00:00 2026-05-11T18:10:28+00:00

I understand that in MVVM: the View knows about the ViewModel the ViewModel knows

  • 0

I understand that in MVVM:

  • the View knows about the ViewModel
  • the ViewModel knows about the Model
  • but it doesn’t work upwards, so the Model knows nothing about the ViewModel
  • and the ViewModel knows nothing about the View

So how does the ViewModel respond to actions that the user does on the View, e.g. type something into a TextBox or move a slider, etc.

  1. I understand that this is done with RoutedEvents but almost all RoutedEvent examples I find use CodeBehind in the View, which is exactly what you don’t have anymore in MVVM.

  2. So that leaves RoutedCommands which I find more examples of in MVVM but e.g. moving a slider really isn’t a command in that sense, it is an event, so I am wondering if this is really what should be used.

  3. Then I read advice such as “In MVVM use RoutedEvents as little as possible, and no RoutedCommands at all.” OK.

  4. So that leaves, e.g. in the WPF Model-View-ViewModel Toolkit 0.1 project form the WPF team themselves you have a “DelegateCommand” which also looks like an interesting way.

  5. Then some people are also using “RelayCommand“.

This is a lot of choices and confusion for doing something so core to developing applications.

What is the best way to simply do in MVVM what we were doing for the last 10 years with Code Behind:

  • create button
  • double-click button
  • write handling code
  • 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-11T18:10:29+00:00Added an answer on May 11, 2026 at 6:10 pm

    Just to be clear, when people mention DelegateCommand and RelayCommand, they are really talking about the same thing: an implementation of ICommand that allows you to pass in a delegate. You can use them interchangeably.

    As far as I am concerned, having your view (XAML) bind to DelegateCommands in the ViewModel is the best way to implement MVVM.

    I stay away from RoutedEvents AND code-behind whenever possible.

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

Sidebar

Related Questions

I'm trying to learn more about WPF and I've read a bit about Model-View-ViewModel
I understand that they are both supposed to be small, but what are the
I understand that requests are served by different threads, but do they all come
The Model-View-ViewModel is very popular with WPF and Silverlight. I've been using this for
I am learning MVVM now and I understand few things (more than but few
I am building a silverlight application using MVVM pattern but I don't understand what
I understand that @synthesize window; combined with @property 'auto-creates' your setters and getters, but
I understand that Internet Explorer is poor at supporting CSS3 - but is there
I understand that some countries have laws regarding website accessibility. In general, what are
I understand that there are several ways to blend XNA and WPF within the

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.