예제 #1
0
        public TableListBoxItemViewModel(TableTreeViewItemViewModel descriptor)
        {
            this.Target     = descriptor;
            this.descriptor = descriptor;

            if (this.descriptor is INotifyPropertyChanged)
            {
                (this.descriptor as INotifyPropertyChanged).PropertyChanged += Descriptor_PropertyChanged;
            }
            this.selectInBrowserCommand = new DelegateCommand(item => this.SelectInBrowser());
        }
예제 #2
0
        public void NewTable()
        {
            var dataSet = new CremaDataSet();

            foreach (var item in this.dataSet.Types)
            {
                item.CopyTo(dataSet);
            }
            var tableName = NameUtility.GenerateNewName("Table", this.dataSet.Tables.Select(item => item.Name));
            var template  = CremaTemplate.Create(dataSet, tableName, this.categoryPath);
            var dialog    = new NewTableViewModel(this.dataSet, template);

            if (dialog.ShowDialog() != true)
            {
                return;
            }

            var dataTable = template.TargetTable.CopyTo(this.dataSet);
            var viewModel = new TableTreeViewItemViewModel(dataTable, this.selector)
            {
                Parent = this,
            };
        }