Esempio n. 1
0
        public TableItemViewModel(Authentication authentication, TableDescriptor descriptor, object owner)
            : base(authentication, descriptor, owner)
        {
            this.contentDescriptor = descriptor.ContentDescriptor;

            this.InsertCommand = new DelegateCommand(async(p) => await this.NewRowAsync());
        }
Esempio n. 2
0
 public TableItemViewModel(Authentication authentication, TableDescriptor descriptor, object owner)
     : base(authentication, descriptor, owner)
 {
     this.contentDescriptor = descriptor.ContentDescriptor;
     //if (this.contentDescriptor.TargetDomain is IDomain domain && domain.Source is CremaDataSet dataSet)
     //{
     //    this.dataTable = dataSet.Tables[this.Name];
     //}
 }
 public TableEditorViewModel(Authentication authentication, TableDescriptor descriptor)
 {
     this.authentication          = authentication;
     this.authentication.Expired += (s, e) => this.Dispatcher.InvokeAsync(() => this.Tables.Clear());
     this.descriptor              = descriptor;
     this.contentDescriptor       = descriptor.ContentDescriptor;
     this.AttachEvent();
     this.DisplayName = descriptor.DisplayName;
     this.Target      = descriptor.Target;
     foreach (var item in EnumerableUtility.FamilyTree(this.descriptor, item => item.Childs))
     {
         this.Tables.Add(new TableItemViewModel(this.authentication, item, this));
     }
     this.Initialize();
 }