using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; namespace Com.Piwigo.Wpf.DTO { public sealed class PwgModelManager { private static System.Threading.SynchronizationContext _synchronizationContext = System.Threading.SynchronizationContext.Current; public static System.Threading.SynchronizationContext WPF_SynchronizationContext { get { return _synchronizationContext; } set { _synchronizationContext = value; } } static readonly PwgModelManagerBase _instance = new PwgModelManagerBase(); // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit static PwgModelManager() { } public static PwgModelManagerBase Instance { get { return _instance; } } public class PwgModelManagerBase : INotifyPropertyChanged { private AsyncObservableCollection _lstMsgInfo = new AsyncObservableCollection(); public AsyncObservableCollection lstMsgInfo { set { _lstMsgInfo = value; OnPropertyChanged("lstMsgInfo"); } get { return _lstMsgInfo; } } private Boolean _booCmdRunning = false; public Boolean booCmdRunning { set { _booCmdRunning = value; OnPropertyChanged("booCmdRunning"); } get { return _booCmdRunning; } } private PwgImageListWPF _imageList; public PwgImageListWPF ImageList { set { _imageList = value; OnPropertyChanged("ImageList"); } get { return _imageList; } } private PwgSessionWPF _session; public PwgSessionWPF Session { set { _session = value; OnPropertyChanged("Session"); } get { return _session; } } private PwgRootCategoryListWPF _categoryList = new PwgRootCategoryListWPF(); public PwgRootCategoryListWPF CategoryList { set { _categoryList = value; OnPropertyChanged("CategoryList"); } get { return _categoryList; } } private PwgRootCategoryWPF _rootCategoryList; public PwgRootCategoryWPF RootCategoryList { set { _rootCategoryList = value; OnPropertyChanged("RootCategoryList"); } get { return _rootCategoryList; } } private PwgImageWPF _imageShown; public PwgImageWPF ImageShown { get { return _imageShown; } set { _imageShown = value; OnPropertyChanged("ImageShown"); } } private PwgTagListWPF _tagsList; public PwgTagListWPF TagsList { set { _tagsList = value; OnPropertyChanged("TagsList"); } get { return _tagsList; } } public event PropertyChangedEventHandler PropertyChanged; internal void OnPropertyChanged(String info) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(info)); } } } }