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 }); }
Introduction
Window Presentation Foundation support Rich Composition, in which you can use a control as a container. In this example i will show, how to put an image into a Button control. If you want to make highly visualize application, must use WPF, because of the strict separation of appearance and behavior you can easily change the look of a control. Now, lets take an simple exampleSource Code (xaml file)
<Grid>
<Button>
<StackPanel Orientation="Horizontal" Width="155">
<Image Source="home.jpg " Height="33" Width="66" Stretch="Uniform"/>
<TextBlock Text=" Home" FontSize="20"/>
</StackPanel>
</Button>
</Grid>
Code Generate the following output
According to above mentioned source code, A Button control contains a stack panel so its work as a container. We already learn about stack panel in previous article. In client based application you can design more powerful application using WPF.
Comments
Post a Comment