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 }); }
How to Navigate from page to specific URL
Add HyperlinkButton control with specified code , code is
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<HyperlinkButton FontSize=" 30" Content="Google.com" NavigateUri=" http://www.google.com" Margin="272,218,0,475" Height="75" />
</Grid>
This code add into MainPage.xaml file
Code generate the following output
How to Navigate from one page to another page in windows store app tutorial
Add click event handler with HyperLinkButton control look like
Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<HyperlinkButton Click="HyperlinkButton_Click" FontSize=" 30" Content="Move to Next page" Margin="272,218,0,475" Height="75" />
</Grid>
Add Handler code in MainPage.xaml.cs file
private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
{
this.Frame.Navigate(typeof(secondpage));
}
Code Generate the following output
Comments
Post a Comment