private void AddDescriptor(DomainDescriptor descriptor)
        {
            var viewModel = descriptor.Host == null?this.CreateInstance(this.authentication, descriptor, this.Owner) : descriptor.Host as DomainTreeItemBase;

            viewModel.Parent = this;
            descriptor.Host  = viewModel;
        }
 private void RemoveDescriptor(DomainDescriptor descriptor)
 {
     foreach (var item in this.Items.ToArray())
     {
         if (item is DomainTreeItemBase viewModel && viewModel.Descriptor == descriptor)
         {
             this.Items.Remove(viewModel);
         }
     }
 }
 protected virtual DomainTreeItemBase CreateInstance(Authentication authentication, DomainDescriptor descriptor, object owner)
 {
     return(new DomainTreeItemBase(authentication, descriptor, owner));
 }