public ContactTagViewModel(IContactTagLocal tag) { _tag = tag; Name = tag.Name; Color = ParseColor(tag.Color); ReadOnly = tag.AddressBook.ReadOnly; }
internal void RemoveTag(IContactTagLocal tag) { if (ReadOnly) { return; } try { _instance.RemoveTag(tag.Key); } catch (Exception ex) { Logger.LogWarn(ex, "Can't remove tag from address book '{0}'.", Name); } }
internal void AddTag(IContactTagLocal tag) { if (tag == null) { return; } if (SelectedContactInfo == null) { return; } if (SelectedContactInfo.Tags.Any(x => x.Id == tag.Id)) { return; } SelectedContactInfo.Tags.Add(tag); NotifyPropertyChanged("Tags"); }