Exemplo n.º 1
0
        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
                });
            }
        }
Exemplo n.º 2
0
 private void RegisterPackage(PackageViewModel item)
 {
     _packagesPerId.Add(item.Id, item);
     item.Items.CollectionChanged += PackageItems_CollectionChanged;
     item.PropertyChanged         += Package_PropertyChanged;
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public LayoutContentItemViewModel(ContentItemBase contentItemBase, PackageViewModel package)
     : base(contentItemBase)
 {
     _package = package;
 }