public RequirementViewModel() { Cache = new Dictionary<int, EsuInfoCollection<Comment>>(); command = new RequirementCrud(null, Load); NotifyOfPropertyChange(() => Command); NotifyOfPropertyChange(() => Visibility); }
private void CurrentItemChanged(Requirement requirement) { if (requirement != null) { requirement.AddCommentCommand = new DelegateCommand<Requirement>(AddComment); requirement.UpdateCommentCommand = new DelegateCommand<Requirement>(UpdateComment); requirement.DeleteCommentCommand = new DelegateCommand<Requirement>(DeleteComment); if (Cache.ContainsKey(requirement.Id)) requirement.Comments = Cache[requirement.Id]; else LoadComment(); } command = new RequirementCrud(requirement, Load); NotifyOfPropertyChange(() => Command); NotifyOfPropertyChange(() => Visibility); }