Exemple #1
0
 public KosmographViewModel(KosmographModel kosmographModel)
 {
     this.model               = kosmographModel;
     this.Tags                = new TagRepositoryViewModel(this.model.Tags);
     this.Entities            = new EntityRepositoryViewModel(this.model.Entities, this.Tags.GetViewModel);
     this.Relationships       = new RelationshipRepositoryViewModel(this.model.Relationships, this.Entities.GetViewModel, this.Tags.GetViewModel);
     this.DeleteEntityCommand = new RelayCommand <EntityViewModel>(this.OnDeletingEntity);
 }
 public KosmographModelTest()
 {
     this.mocks              = new MockRepository(MockBehavior.Strict);
     this.persistence        = this.mocks.Create <IKosmographPersistence>();
     this.categoryRepository = this.mocks.Create <ICategoryRepository>();
     this.tagRepository      = this.mocks.Create <ITagRepository>();
     this.model              = new KosmographModel(this.persistence.Object);
 }
Exemple #3
0
        private void CreateNewModel()
        {
            var model         = new KosmographModel(new KosmographLiteDbPersistence());
            var tag1          = model.Tags.Upsert(new Tag("tag1", new Facet("facet", new FacetProperty("p1"))));
            var tag2          = model.Tags.Upsert(new Tag("tag2", new Facet("facet", new FacetProperty("p2"))));
            var entity1       = model.Entities.Upsert(new Entity("entity1", tag1));
            var entity2       = model.Entities.Upsert(new Entity("entity2", tag2));
            var entity3       = model.Entities.Upsert(new Entity("entity3", tag1));
            var relationship1 = model.Relationships.Upsert(new Relationship("relationship1", entity1, entity2, tag1));
            var relationship2 = model.Relationships.Upsert(new Relationship("relationship2", entity2, entity3, tag1));
            var viewModel     = new KosmographViewModel(model);

            viewModel.FillAll();
            this.ViewModel = viewModel;

            CommandManager.InvalidateRequerySuggested();
        }