internal void AddReference(ContentItemViewModelReference contentItem, PackageViewModel package) { List <PackageReference> packages; if (!_references.TryGetValue(contentItem.ContentItem, out packages)) { packages = new List <PackageReference>(); _references.Add(contentItem.ContentItem, packages); } packages.Add(new PackageReference { IsExplicit = contentItem.IsExplicit, Package = package }); // Notify if (ReferenceAdded != null) { ReferenceAdded(this, new ReferenceArgs() { ContentItem = contentItem, Package = package }); } }
private void RegisterPackage(PackageViewModel item) { _packagesPerId.Add(item.Id, item); item.Items.CollectionChanged += PackageItems_CollectionChanged; item.PropertyChanged += Package_PropertyChanged; }
internal bool HasExplicitReferencesToPackage(ContentItemViewModel contentItem, PackageViewModel package) { List <PackageReference> packages = null; _references.TryGetValue(contentItem, out packages); return(packages != null && packages.Any(p => p.IsExplicit == true && p.Package == package)); }
public LayoutContentItemViewModel(ContentItemBase contentItemBase, PackageViewModel package) : base(contentItemBase) { _package = package; }