Exemple #1
0
 public TypeListBoxItemViewModel(TypeTreeViewItemViewModel 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());
 }
Exemple #2
0
        public void NewType()
        {
            var dataSet = new CremaDataSet();

            foreach (var item in this.dataSet.Types)
            {
                item.CopyTo(dataSet);
            }
            var dataType = dataSet.Types.Add();
            var dialog   = new NewTypeViewModel(dataType);

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

            var copiedType = dataType.CopyTo(this.dataSet);
            //var dataType = template.TargetType.CopyTo(this.dataSet);
            var viewModel = new TypeTreeViewItemViewModel(copiedType, this.selector)
            {
                Parent = this,
            };
        }