source: extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs @ 12015

Last change on this file since 12015 was 12015, checked in by bayral, 13 years ago

retrieve tags list and image for a tag.

File size: 3.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.ComponentModel;
6
7namespace Com.Piwigo.Wpf.DTO
8{
9    public sealed class PwgModelManager
10    {
11        private static System.Threading.SynchronizationContext _synchronizationContext = System.Threading.SynchronizationContext.Current;
12
13        public static System.Threading.SynchronizationContext WPF_SynchronizationContext
14        {
15            get {
16                return _synchronizationContext;
17            }
18            set {
19                _synchronizationContext = value;
20            }
21        }
22
23        static readonly PwgModelManagerBase _instance = new PwgModelManagerBase();
24
25        // Explicit static constructor to tell C# compiler
26        // not to mark type as beforefieldinit
27        static PwgModelManager()
28        {
29        }
30
31        public static PwgModelManagerBase Instance
32        {
33            get
34            {
35                return _instance;
36            }
37        }
38
39        public class PwgModelManagerBase : INotifyPropertyChanged
40        {
41            private AsyncObservableCollection<String> _lstMsgInfo = new AsyncObservableCollection<String>();
42            public AsyncObservableCollection<String> lstMsgInfo
43            {
44                set { _lstMsgInfo = value; OnPropertyChanged("lstMsgInfo"); }
45                get { return _lstMsgInfo; }
46            }
47
48            private Boolean _booCmdRunning = false;
49            public Boolean booCmdRunning
50            {
51                set { _booCmdRunning = value; OnPropertyChanged("booCmdRunning"); }
52                get { return _booCmdRunning; }
53            }
54
55            private PwgImageListWPF _imageList;
56            public PwgImageListWPF ImageList
57            {
58                set { _imageList = value; OnPropertyChanged("ImageList"); }
59                get { return _imageList; }
60            }
61
62            private PwgSessionWPF _session;
63            public PwgSessionWPF Session
64            {
65                set { _session = value; OnPropertyChanged("Session"); }
66                get { return _session; }
67            }
68
69            private PwgRootCategoryListWPF _categoryList = new PwgRootCategoryListWPF();
70            public PwgRootCategoryListWPF CategoryList
71            {
72                set { _categoryList = value; OnPropertyChanged("CategoryList"); }
73                get { return _categoryList; }
74            }
75
76            private PwgRootCategoryWPF _rootCategoryList;
77            public PwgRootCategoryWPF RootCategoryList
78            {
79                set { _rootCategoryList = value; OnPropertyChanged("RootCategoryList"); }
80                get { return _rootCategoryList; }
81            }
82
83
84            private PwgImageWPF _imageShown;
85            public PwgImageWPF ImageShown
86            {
87                get { return _imageShown; }
88                set { _imageShown = value; OnPropertyChanged("ImageShown"); }
89            }
90
91            private PwgTagListWPF _tagsList;
92            public PwgTagListWPF TagsList
93            {
94                set { _tagsList = value; OnPropertyChanged("TagsList"); }
95                get { return _tagsList; }
96            }
97
98            public event PropertyChangedEventHandler PropertyChanged;
99            internal void OnPropertyChanged(String info)
100            {
101                if (PropertyChanged != null)
102                    PropertyChanged(this, new PropertyChangedEventArgs(info));
103            }
104
105 
106        }
107    }
108}
Note: See TracBrowser for help on using the repository browser.