using Caliburn.Micro; namespace Pithos.Client.WPF { public class Permission:PropertyChangedBase { private string _userName; public string UserName { get { return _userName; } set { _userName = value; NotifyOfPropertyChange(()=>UserName); } } private bool _read; public bool Read { get { return _read; } set { _read = value; if (_read) Write = false; NotifyOfPropertyChange(()=>Read); } } private bool _write; public bool Write { get { return _write; } set { _write = value; if (_write) Read = false; NotifyOfPropertyChange(()=>Write); } } public Permission(string userName, string permission) { UserName = userName; Read = (string.Compare(permission, "read", true) == 0); Write= (string.Compare(permission, "write", true) == 0); //Value = permission; } public string Value { get { if (Write) return "write"; if (Read) return "read"; return null; } } public Permission() { } } }