public Window1() { InitializeComponent(); if (File.Exists("Schemas.xml")) { EntitySchema.LoadSchemas("Schemas.xml"); } coll = this.FindResource("Schemas") as EntitySchemaCollection; CurrentFileName = string.Empty; }
public EntitySchemaViewModel(EntitySchemaCollection srcCollection, EntitySchema schema) { Attributes = new ObservableCollection<ItemInfoKVP>(); this.Schema = schema; this.EntityType = schema.EntityType; this.Category = schema.Category; this.SupportedEntities = new ObservableCollection<string>(); foreach ( var se in schema.SupportedEntityTypes ) { SupportedEntities.Add(se); } foreach ( var kvp in schema.Attributes ) { ItemInfoKVP item = new ItemInfoKVP() { Key = kvp.Key, Value = kvp.Value}; Attributes.Add(item); item.OnItemEndEdit += item_OnItemEndEdit; item.PropertyChanged += item_PropertyChanged; item.PropertyChanging += item_PropertyChanging; } Attributes.CollectionChanged += Attributes_CollectionChanged; }