using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; namespace Com.Piwigo.Wpf.DTO { public sealed class PwgModelManager { 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 PwgCategoryListWPF _categoryList; public PwgCategoryListWPF CategoryList { set { _categoryList = value; OnPropertyChanged("CategoryList"); } get { return _categoryList; } } private PwgImageWPF _imageShown; public PwgImageWPF ImageShown { get { return _imageShown; } set { _imageShown = value; OnPropertyChanged("ImageShown"); } } public event PropertyChangedEventHandler PropertyChanged; internal void OnPropertyChanged(String info) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(info)); } } } }