Click here to Skip to main content
12,077,594 members (47,163 online)
Click here to Skip to main content


141 bookmarked

Using RoutedCommands with a ViewModel in WPF

, 24 Jul 2008 CPOL
Reviews a clean and lightweight way to use RoutedCommands in the MVVM pattern.
namespace VMCommanding.Model
    /// <summary>
    /// Stores attributes of a person.
    /// </summary>
    public class Person
        public static Person[] GetPeople()
            return new Person[]
                new Person("Barney", 30),
                new Person("Fred", 32),
                new Person("Wilma", 28)

        private Person(string name, int age)
            this.Name = name;
            this.Age = age;
            this.IsAlive = true;

        public int Age { get; private set; }
        public bool IsAlive { get; set; }
        public string Name { get; private set; }

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Josh Smith
Software Developer (Senior) Cynergy Systems
United States United States
Josh creates software, for iOS and Windows.

He works at Cynergy Systems as a Senior Experience Developer.

Read his iOS Programming for .NET Developers[^] book to learn how to write iPhone and iPad apps by leveraging your existing .NET skills.

Use his Master WPF[^] app on your iPhone to sharpen your WPF skills on the go.

Check out his Advanced MVVM[^] book.

Visit his WPF blog[^] or stop by his iOS blog[^].

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160212.1 | Last Updated 24 Jul 2008
Article Copyright 2008 by Josh Smith
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid