PageRenderTime 49ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/V2.2/trunk/Quickstarts/UI Composition/ViewDiscovery/Desktop/UIComposition.Modules.Project/Views/ProjectsListView/ProjectsListPresentationModel.cs

#
C# | 74 lines | 50 code | 8 blank | 16 comment | 6 complexity | cd999ec45625aa4c3918221b0ed5c0a9 MD5 | raw file
  1. //===================================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation and Silverlight
  4. //===================================================================================
  5. // Copyright (c) Microsoft Corporation. All rights reserved.
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  7. // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  8. // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  9. // FITNESS FOR A PARTICULAR PURPOSE.
  10. //===================================================================================
  11. // The example companies, organizations, products, domain names,
  12. // e-mail addresses, logos, people, places, and events depicted
  13. // herein are fictitious. No association with any real company,
  14. // organization, product, domain name, email address, logo, person,
  15. // places, or events is intended or should be inferred.
  16. //===================================================================================
  17. using System.Collections.ObjectModel;
  18. using System.ComponentModel;
  19. namespace UIComposition.Modules.Project
  20. {
  21. public class ProjectsListPresentationModel : INotifyPropertyChanged
  22. {
  23. private int employeeId;
  24. private ObservableCollection<BusinessEntities.Project> projects;
  25. public event PropertyChangedEventHandler PropertyChanged;
  26. public ObservableCollection<BusinessEntities.Project> Projects
  27. {
  28. get
  29. {
  30. return this.projects;
  31. }
  32. set
  33. {
  34. if (this.projects != value)
  35. {
  36. this.projects = value;
  37. this.OnPropertyChanged("Projects");
  38. }
  39. }
  40. }
  41. public int EmployeeId
  42. {
  43. get
  44. {
  45. return this.employeeId;
  46. }
  47. set
  48. {
  49. if (this.employeeId != value)
  50. {
  51. this.employeeId = value;
  52. this.OnPropertyChanged("EmployeeId");
  53. }
  54. }
  55. }
  56. public static string HeaderInfo
  57. {
  58. get { return "Current Projects"; }
  59. }
  60. private void OnPropertyChanged(string propertyName)
  61. {
  62. PropertyChangedEventHandler Handler = this.PropertyChanged;
  63. if (Handler != null) Handler(this, new PropertyChangedEventArgs(propertyName));
  64. }
  65. }
  66. }