I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
ListBox is a container in which we can add strings. User can select by clicking. Article contain different topics , these are 1. Add ListBox Control with items using XAML 2. Add ListBox Control in code file There are some basic steps to complete that tasks Add ListBox control with items using XAML Step-1 : Add ListBox control in contentPanel using xaml code , now your code llok like <ListBox x:Name=" ListBox1" > </ListBox> Step-2 : Open ListBox properties and select Items(collection) ellipse symbol. After pressing ellipse button , A new window will appear Step-3 : Using Object Collection Editor, add controls to the List Box by selecting controls from Dropdown List. Step-4 : After adding controls, you can assign content property of them. Step-5 : Now, Press Ok button after adding items. Step-6 : Now , Your complete code look like <ListBox x:Name=" L1" > <ListBoxItem Content="Apple"