Advertisement
Guest User

ViewModel.cs

a guest
May 19th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.31 KB | None | 0 0
  1. using GalaSoft.MvvmLight;
  2. using MvvmLight5.Model;
  3. using System.Collections.Generic;
  4.  
  5. namespace MvvmLight5.ViewModel
  6. {
  7.     public class MainViewModel : ViewModelBase
  8.     {
  9.         private readonly IDataService _dataService;
  10.         public const string WelcomeTitlePropertyName = "WelcomeTitle";
  11.         private string _welcomeTitle = string.Empty;
  12.         public string WelcomeTitle
  13.         {
  14.             get
  15.             {
  16.                 return _welcomeTitle;
  17.             }
  18.             set
  19.             {
  20.                 if (_welcomeTitle == value)
  21.                 {
  22.                     return;
  23.                 }
  24.                 _welcomeTitle = value;
  25.                 RaisePropertyChanged(WelcomeTitlePropertyName);
  26.             }
  27.         }
  28.         public const string theTextPropertyName = "theText";
  29.         private string _theText = string.Empty;
  30.         public string theText
  31.         {
  32.             get
  33.             {
  34.                 return _theText;
  35.             }
  36.             set
  37.             {
  38.                 if (_theText == value)
  39.                 {
  40.                     return;
  41.                 }
  42.                 _welcomeTitle = value;
  43.                 RaisePropertyChanged(WelcomeTitlePropertyName);
  44.             }
  45.         }
  46.  
  47.         public Dictionary<string, string> theDictionary;
  48.         private List<Dictionary<string, string>> _theList;
  49.         public const string theListPropertyName = "theList";
  50.         public List<Dictionary<string, string>> theList
  51.         {
  52.             get
  53.             {
  54.                 return _theList;
  55.             }
  56.             set
  57.             {
  58.                 if (_theList == value)
  59.                     return;
  60.                 _theList = value;
  61.                 RaisePropertyChanged(theListPropertyName);
  62.             }
  63.         }
  64.  
  65.         /// <summary>
  66.         /// Initializes a new instance of the MainViewModel class.
  67.         /// </summary>
  68.         public MainViewModel(IDataService dataService)
  69.         {
  70.             List<Dictionary<string, string>> x = new List<Dictionary<string, string>>();
  71.             theDictionary = new Dictionary<string, string>();
  72.             theDictionary.Add("1", "A");
  73.             theDictionary.Add("2", "B");
  74.             theList = new List<Dictionary<string, string>>();
  75.             theList.Add(theDictionary);
  76.  
  77.         }
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement