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 }); }
Canvas is the basic panel. One can simply place children in a canvas with its attached properties left, top, right and bottom. One should have some knowledge of graph paper to use a canvas panel in WPF. This works as margin property of an element.
I have placed some buttons in a canvas as in following image:
The buttons in above image can be simply placed by using following xaml code:
It is the most lightweight panel for creating flexible user interfaces. One should keep it in mind for maximum performance when one need precise control over the placement of elements. A child can use only two of the canvas attached properties at a time, remaining will be ignored. It means one cant dock an element to more than one corner of a canvas.
I have placed some buttons in a canvas as in following image:
<Canvas>
<Button Content="First" Canvas.Left="10" Canvas.Top="10"></Button>
<Button Content="Second" Canvas.Top="10" Canvas.Right="10"></Button>
<Button Content="Third" Canvas.Bottom="50" Canvas.Right="50"></Button>
</Canvas>
<Button Content="First" Canvas.Left="10" Canvas.Top="10"></Button>
<Button Content="Second" Canvas.Top="10" Canvas.Right="10"></Button>
<Button Content="Third" Canvas.Bottom="50" Canvas.Right="50"></Button>
</Canvas>
It is the most lightweight panel for creating flexible user interfaces. One should keep it in mind for maximum performance when one need precise control over the placement of elements. A child can use only two of the canvas attached properties at a time, remaining will be ignored. It means one cant dock an element to more than one corner of a canvas.
Comments
Post a Comment