Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Catel - Part 3 of n: The MVVM Framework

, 28 Jan 2011 CPOL
This article explains the MVVM framework that ships with Catel.
catel-03_01-mvvm-framework.zip
Catel.Articles.Base.dll
Catel.Core.dll
Catel.Windows.dll
log4net.dll
Examples
BasicViewModel
DataWindow
Catel.Articles.03 - MVVM.exe
ControlToViewModelWithWindow
ControlToViewModelWithControl
Microsoft.Practices.Unity.dll
System.Windows.Interactivity.dll
catel-03_01-mvvmframework.zip
Catel.Articles.Base.dll
Catel.Core.dll
Catel.Windows.dll
log4net.dll
Catel.Articles.03 - MVVM.exe
using System.Windows;
using Catel.Articles._03___MVVM.UI.ViewModels;
using Catel.MVVM.UI;
using Catel.Windows;

namespace Catel.Articles._03___MVVM.Examples.ControlToViewModelWithWindow
{
    /// <summary>
    /// Interaction logic for WindowWithViewModelMappings.xaml
    /// </summary>
    public partial class WindowWithViewModelMappings : DataWindow<PersonViewModel>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="WindowWithViewModelMappings"/> class.
        /// </summary>
        public WindowWithViewModelMappings()
        {
            // Initialize component
            InitializeComponent();
        }

        /// <summary>
        /// Gets or sets the first name.
        /// </summary>
        /// <value>The first name.</value>
        [ControlToViewModel]
        public string FirstName
        {
            get { return (string)GetValue(FirstNameProperty); }
            set { SetValue(FirstNameProperty, value); }
        }

        // Using a DependencyProperty as the backing store for FirstName.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty FirstNameProperty =
            DependencyProperty.Register("FirstName", typeof(string), typeof(WindowWithViewModelMappings), new UIPropertyMetadata(string.Empty));
    }
}

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)

Share

About the Author

Geert van Horrik
Software Developer CatenaLogic
Netherlands Netherlands
I am Geert van Horrik, and I have studied Computer Science in the Netherlands.
 
I love to write software using .NET (especially the combination of WPF and C#). I am also the lead developer of Catel, an open-source application development framework for WPF, Silverlight, WP7 and WinRT with the focus on MVVM.
 
I have my own company since January 1st 2007, called CatenaLogic. This company develops commercial and non-commercial software.
 
To download (or buy) applications I have written, visit my website: http://www.catenalogic.com
Follow on   Twitter

| Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 28 Jan 2011
Article Copyright 2010 by Geert van Horrik
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid