1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using System.ComponentModel; |
---|
6 | |
---|
7 | namespace 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 PwgRootAlbumListWPF _AlbumList = new PwgRootAlbumListWPF(); |
---|
70 | public PwgRootAlbumListWPF AlbumList |
---|
71 | { |
---|
72 | set { _AlbumList = value; OnPropertyChanged("AlbumList"); } |
---|
73 | get { return _AlbumList; } |
---|
74 | } |
---|
75 | |
---|
76 | private PwgRootAlbumWPF _rootAlbumList; |
---|
77 | public PwgRootAlbumWPF RootAlbumList |
---|
78 | { |
---|
79 | set { _rootAlbumList = value; OnPropertyChanged("RootAlbumList"); } |
---|
80 | get { return _rootAlbumList; } |
---|
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 | private LocalPwgAlbumListWPF _localAlbumToImport; |
---|
99 | public LocalPwgAlbumListWPF LocalAlbumToImport |
---|
100 | { |
---|
101 | set { _localAlbumToImport = value; OnPropertyChanged("LocalAlbumToImport"); } |
---|
102 | get { return _localAlbumToImport; } |
---|
103 | } |
---|
104 | |
---|
105 | |
---|
106 | public event PropertyChangedEventHandler PropertyChanged; |
---|
107 | internal void OnPropertyChanged(String info) |
---|
108 | { |
---|
109 | if (PropertyChanged != null) |
---|
110 | PropertyChanged(this, new PropertyChangedEventArgs(info)); |
---|
111 | } |
---|
112 | |
---|
113 | |
---|
114 | } |
---|
115 | } |
---|
116 | } |
---|