Example #1
0
        public PackageViewModel(SessionViewModel session, PackageContainer packageContainer, bool packageAlreadyInSession)
            : base(session)
        {
            PackageContainer = packageContainer;
            Package          = PackageContainer.Package;
            HasBeenUpgraded  = Package.IsDirty;
            DependentProperties.Add(nameof(PackagePath), new[] { nameof(Name), nameof(RootDirectory) });
            Dependencies    = new DependencyCategoryViewModel(nameof(Dependencies), this, session, Package.RootAssets);
            AssetMountPoint = new AssetMountPointViewModel(this);
            content.Add(AssetMountPoint);
            content.Add(Dependencies);
            RenameCommand = new AnonymousCommand(ServiceProvider, () => IsEditing = true);
            IsLoaded      = Package.State >= PackageState.AssetsReady;

            // IsDeleted will make the package added to Session.LocalPackages, so let's do it last
            InitialUndelete(!packageAlreadyInSession);

            DeletedAssets.CollectionChanged += DeletedAssetsChanged;
        }
Example #2
0
 public DirectDependencyReferenceViewModel(DependencyRange dependency, PackageViewModel referencer, DependencyCategoryViewModel dependencies, bool canUndoRedoCreation)
     : base(referencer, dependencies)
 {
     this.dependency = dependency;
     InitialUndelete(canUndoRedoCreation);
 }
Example #3
0
 protected PackageReferenceViewModel(PackageViewModel referencer, DependencyCategoryViewModel dependencies)
     : base(referencer.SafeArgument(nameof(referencer)).Session)
 {
     this.dependencies = dependencies;
     Referencer        = referencer;
 }