1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Text; |
---|
4 | |
---|
5 | using Com.Piwigo.Lib.DTO; |
---|
6 | using System.ComponentModel; |
---|
7 | using System.Collections.ObjectModel; |
---|
8 | |
---|
9 | namespace Com.Piwigo.Wpf.DTO |
---|
10 | { |
---|
11 | |
---|
12 | public class PwgCategoryWPF : INotifyPropertyChanged |
---|
13 | { |
---|
14 | private Int32 _id; |
---|
15 | public Int32 Id |
---|
16 | { |
---|
17 | set { _id = value; OnPropertyChanged("Id"); } |
---|
18 | get { return _id; } |
---|
19 | } |
---|
20 | |
---|
21 | private ObservableCollection<Int32> _upperCategoriesId; |
---|
22 | public ObservableCollection<Int32> UpperCategoriesId |
---|
23 | { |
---|
24 | set { _upperCategoriesId = value; OnPropertyChanged("UpperCategoriesId"); } |
---|
25 | get { return _upperCategoriesId; } |
---|
26 | } |
---|
27 | |
---|
28 | private String _name; |
---|
29 | public String Name |
---|
30 | { |
---|
31 | set { _name = value; OnPropertyChanged("Name"); } |
---|
32 | get { return _name; } |
---|
33 | } |
---|
34 | |
---|
35 | private Uri _url; |
---|
36 | public Uri Url |
---|
37 | { |
---|
38 | set { _url = value; OnPropertyChanged("Url"); } |
---|
39 | get { return _url; } |
---|
40 | } |
---|
41 | |
---|
42 | private Int64 _imagesCount; |
---|
43 | public Int64 ImagesCount |
---|
44 | { |
---|
45 | set { _imagesCount = value; OnPropertyChanged("ImagesCount"); } |
---|
46 | get { return _imagesCount; } |
---|
47 | } |
---|
48 | |
---|
49 | private Int64 _deepImagesCount; |
---|
50 | public Int64 DeepImagesCount |
---|
51 | { |
---|
52 | set { _deepImagesCount = value; OnPropertyChanged("DeepImagesCount"); } |
---|
53 | get { return _deepImagesCount; } |
---|
54 | } |
---|
55 | |
---|
56 | private Int64 _subCategoriesCount; |
---|
57 | public Int64 SubCategoriesCount |
---|
58 | { |
---|
59 | set { _subCategoriesCount = value; OnPropertyChanged("SubCategoriesCount"); } |
---|
60 | get { return _subCategoriesCount; } |
---|
61 | } |
---|
62 | |
---|
63 | private DateTime _lastDate; |
---|
64 | public DateTime LastDate |
---|
65 | { |
---|
66 | set { _lastDate = value; OnPropertyChanged("LastDate"); } |
---|
67 | get { return _lastDate; } |
---|
68 | } |
---|
69 | |
---|
70 | |
---|
71 | public event PropertyChangedEventHandler PropertyChanged; |
---|
72 | private void OnPropertyChanged(String info) |
---|
73 | { |
---|
74 | if (PropertyChanged != null) |
---|
75 | PropertyChanged(this, new PropertyChangedEventArgs(info)); |
---|
76 | } |
---|
77 | |
---|
78 | #region Presentation Members |
---|
79 | |
---|
80 | #region IsExpanded |
---|
81 | |
---|
82 | /// <summary> |
---|
83 | /// Gets/sets whether the TreeViewItem |
---|
84 | /// associated with this object is expanded. |
---|
85 | /// </summary> |
---|
86 | private bool _isExpanded = false; |
---|
87 | public bool IsExpanded |
---|
88 | { |
---|
89 | get { return _isExpanded; } |
---|
90 | set |
---|
91 | { |
---|
92 | if (value != _isExpanded) |
---|
93 | { |
---|
94 | _isExpanded = value; |
---|
95 | this.OnPropertyChanged("IsExpanded"); |
---|
96 | } |
---|
97 | |
---|
98 | // Expand all the way up to the root. |
---|
99 | if (_isExpanded && _parent != null) |
---|
100 | _parent.IsExpanded = true; |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | #endregion // IsExpanded |
---|
105 | |
---|
106 | #region IsSelected |
---|
107 | |
---|
108 | /// <summary> |
---|
109 | /// Gets/sets whether the TreeViewItem |
---|
110 | /// associated with this object is selected. |
---|
111 | /// </summary> |
---|
112 | private bool _isSelected = false; |
---|
113 | public bool IsSelected |
---|
114 | { |
---|
115 | get { return _isSelected; } |
---|
116 | set |
---|
117 | { |
---|
118 | if (value != _isSelected) |
---|
119 | { |
---|
120 | _isSelected = value; |
---|
121 | this.OnPropertyChanged("IsSelected"); |
---|
122 | } |
---|
123 | } |
---|
124 | } |
---|
125 | |
---|
126 | #endregion // IsSelected |
---|
127 | |
---|
128 | #region Parent |
---|
129 | private PwgCategoryWPF _parent = null; |
---|
130 | public PwgCategoryWPF Parent |
---|
131 | { |
---|
132 | get { return _parent; } |
---|
133 | } |
---|
134 | |
---|
135 | #endregion // Parent |
---|
136 | |
---|
137 | #endregion // Presentation Members |
---|
138 | } |
---|
139 | } |
---|