Beispiel #1
0
        private void AddDescriptor(UserDescriptor descriptor)
        {
            var viewModel = descriptor.Host == null?this.CreateInstance(this.authentication, descriptor, this.Owner) : descriptor.Host as UserTreeItemBase;

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