Click here to Skip to main content
15,897,371 members
Articles / Desktop Programming / WPF

Executing Command Logic in a View Model

Rate me:
Please Sign up or sign in to vote.
4.94/5 (54 votes)
9 Mar 2011CPOL14 min read 305.6K   2.8K   142  
Introduces the RoutedCommandBinding class as a new way for invoking methods in a View Model directly from XAML in an MVVM application.
using System;
using System.Windows.Input;

namespace RoutedCommandBindingSample
{
    public static class MyMediaCommands
    {
        private static readonly RoutedCommand _Pause = new RoutedCommand("Pause", typeof(MyMediaCommands));

        public static RoutedCommand Pause { get { return _Pause; } }
    }
}

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.

License

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


Written By
Software Developer Fidelity National Financial
United States United States
Doug Schott has been developing .NET applications for the past 8 years.

He is currently working as a senior software consultant at Fidelity National Financial.

Comments and Discussions