[11904] | 1 | using System; |
---|
| 2 | using System.Collections.Generic; |
---|
| 3 | using System.Linq; |
---|
| 4 | using System.Text; |
---|
[11905] | 5 | using System.ComponentModel; |
---|
[11904] | 6 | |
---|
| 7 | namespace Com.Piwigo.Wpf.DTO |
---|
| 8 | { |
---|
| 9 | public sealed class PwgModelManager |
---|
| 10 | { |
---|
[11935] | 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 | |
---|
[11904] | 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 | |
---|
[11926] | 39 | public class PwgModelManagerBase : INotifyPropertyChanged |
---|
[11904] | 40 | { |
---|
[11922] | 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 | |
---|
[11905] | 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 | |
---|
[11935] | 69 | private PwgRootCategoryListWPF _categoryList = new PwgRootCategoryListWPF(); |
---|
| 70 | public PwgRootCategoryListWPF CategoryList |
---|
[11905] | 71 | { |
---|
| 72 | set { _categoryList = value; OnPropertyChanged("CategoryList"); } |
---|
| 73 | get { return _categoryList; } |
---|
| 74 | } |
---|
| 75 | |
---|
[11935] | 76 | private PwgRootCategoryWPF _rootCategoryList; |
---|
| 77 | public PwgRootCategoryWPF RootCategoryList |
---|
| 78 | { |
---|
| 79 | set { _rootCategoryList = value; OnPropertyChanged("RootCategoryList"); } |
---|
| 80 | get { return _rootCategoryList; } |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | |
---|
[11926] | 84 | private PwgImageWPF _imageShown; |
---|
| 85 | public PwgImageWPF ImageShown |
---|
| 86 | { |
---|
| 87 | get { return _imageShown; } |
---|
| 88 | set { _imageShown = value; OnPropertyChanged("ImageShown"); } |
---|
| 89 | } |
---|
[12015] | 90 | |
---|
| 91 | private PwgTagListWPF _tagsList; |
---|
| 92 | public PwgTagListWPF TagsList |
---|
| 93 | { |
---|
| 94 | set { _tagsList = value; OnPropertyChanged("TagsList"); } |
---|
| 95 | get { return _tagsList; } |
---|
| 96 | } |
---|
| 97 | |
---|
[11905] | 98 | public event PropertyChangedEventHandler PropertyChanged; |
---|
[11922] | 99 | internal void OnPropertyChanged(String info) |
---|
[11905] | 100 | { |
---|
| 101 | if (PropertyChanged != null) |
---|
| 102 | PropertyChanged(this, new PropertyChangedEventArgs(info)); |
---|
| 103 | } |
---|
[12015] | 104 | |
---|
| 105 | |
---|
[11904] | 106 | } |
---|
| 107 | } |
---|
| 108 | } |
---|