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 }); }
In this article, I will teach you, how to change Background color, foreground color, font style, and many more things. I explained already many more things about WPF Listview like
- How to add items in it using XAML code
- How to bind the WPF Listview.view from Gridview.
- WPF Listview binding from EDMX file
- Binding it with List of string type.
Also covered many more articles, which is related to styling and formatting. You can see my video article for Learn WPF styling using static as well as dynamic. Today, I will put some styles in XAML code. Let's see
Code generates the following output
<ListView Name="list1" HorizontalAlignment="Left" VerticalAlignment="Top">
<ListViewItem FontFamily="Times New Roman" FontSize="15" Foreground="Red" Background="Green" BorderBrush="AliceBlue" BorderThickness="2">Apple</ListViewItem>
<ListViewItem FontSize="16" Foreground="Green" Background="orange" BorderBrush="AliceBlue" BorderThickness="2">Orange</ListViewItem>
<ListViewItem FontSize="17" Foreground="Red" Background="White" BorderBrush="AliceBlue" BorderThickness="2">Pea</ListViewItem>
<ListBoxItem>
</ListBoxItem>
</ListView>
Code generates the following output
Comments
Post a Comment