Click here to Skip to main content
15,886,664 members
Articles / Desktop Programming / WPF

MVVM for Multi Platforms

Rate me:
Please Sign up or sign in to vote.
4.13/5 (6 votes)
22 Mar 2010CPOL2 min read 26.4K   354   22  
How to implement MVVM when developing a view model whose view implementation language is not certain
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GeographicRepresentation.Interfaces
{
    /// <summary>
    /// Present data of a city
    /// </summary>
    public interface ICityViewModel
    {
        #region Properties

        /// <summary>
        /// A unique key for specifying the city. This property can't be edited
        /// </summary>
        Guid Id
        {
            get;
        }

        string CityName
        {
            get;
            set;
        }

        int Population
        {
            get;
            set;
        }

        /// <summary>
        /// The difference of the Time zone
        /// </summary>
        short TimeZone
        {
            get;
            set;
        }

        #endregion 

        #region Methods

        /// <summary>
        /// Get the current time in the destination
        /// </summary>
        /// <returns></returns>
        DateTime GetCurrentTime();

        #endregion
    }

    /// <summary>
    /// This interface presents a view model for simply viewing data over the city, without the ability to change it
    /// </summary>
    public interface IReadOnlyCityViewModel : ICityViewModel, IReadOnlyViewModel
    {
        
    }

    /// <summary>
    /// This interface presents a view model for adding or editing data over a city
    /// </summary>
    public interface IEditableCityViewModel : ICityViewModel, IEditableObject
    {
    }
}

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
Israel Israel
Software Developer in a promising Clean-Tech company

Comments and Discussions