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 }); }
Step-1 : Double-click MainPage.xaml in Solution Explorer to open it.
Step-2 : In XAML or design view, add a TextBlock with some Text like " Greeting".
Step-3 : In the Properties Window, Expand the Miscellaneous group and find the Style property.
Step-4 : Click the property marker next to the Style property to open the menu.
Step-5 : In the menu, select System Resource > BodyTextBlockStyle.
when your mouse pointer come to object(TextBlock), a blue outline shows where the TextBlock is so you can select it.
Step-2 : In XAML or design view, add a TextBlock with some Text like " Greeting".
Step-3 : In the Properties Window, Expand the Miscellaneous group and find the Style property.
Step-4 : Click the property marker next to the Style property to open the menu.
Step-5 : In the menu, select System Resource > BodyTextBlockStyle.
when your mouse pointer come to object(TextBlock), a blue outline shows where the TextBlock is so you can select it.
Complete Source code
<Page
x:Class="App4.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App4"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock HorizontalAlignment="Left" Margin="184,216,0,0" TextWrapping="Wrap" Text="Greeting" FontSize="20" VerticalAlignment="Top" Height="44" Width="349" Style="{StaticResource BodyTextBlockStyle}"/>
</Grid>
</Page>
Comments
Post a Comment