Click here to Skip to main content
15,894,180 members
Articles / Desktop Programming / WPF

Modeling M-V-VM

Rate me:
Please Sign up or sign in to vote.
3.71/5 (8 votes)
5 Jun 2009CPOL2 min read 26.9K   312   23  
An article which tries to present an approach for decoupling M-V-VM View Model objects
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

using WorldDataLib.Model;

namespace WorldServiceLib
{
    // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in App.config.
    public class WorldDataService : IWorldDataService
    {
        StabWorldDataManager m_WorldDataManager = new StabWorldDataManager();

        public double GetContinentSizeInSquareMiles(string strContinent)
        {
            Console.WriteLine(string.Format("Requesting GetContinentSizeInSquareMiles for {0}", strContinent));
            return m_WorldDataManager.GetContinentSizeInSquareMiles(strContinent);
        }

        public CurrenciesEnum GetCountryCurrency(string strCountry)
        {
            Console.WriteLine(string.Format("Requesting GetCountryCurrency for {0}", strCountry));
            return m_WorldDataManager.GetCountryCurrency(strCountry);
        }

        public double GetCityCurrentTemprature(string strCity)
        {
            Console.WriteLine(string.Format("Requesting GetCityCurrentTemprature for {0}", strCity));
            return m_WorldDataManager.GetCityCurrentTemprature(strCity);
        }
    }
}

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