0% found this document useful (0 votes)
9 views3 pages

HomPage.xaml

The document is a XAML file defining the layout and styles for a HomePage in a MAUI application. It includes various UI components such as labels, frames, and scroll views to display popular tags, latest news, recommended articles, and popular articles. The file utilizes data binding to connect UI elements to the underlying view model for dynamic content rendering.

Uploaded by

Raji Mol
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

HomPage.xaml

The document is a XAML file defining the layout and styles for a HomePage in a MAUI application. It includes various UI components such as labels, frames, and scroll views to display popular tags, latest news, recommended articles, and popular articles. The file utilizes data binding to connect UI elements to the underlying view model for dynamic content rendering.

Uploaded by

Raji Mol
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

HomPage.

xaml

<!--<?xml version="1.0" encoding="utf-8" ?>


<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:models="clr-namespace:MAUIDemo.Models"
xmlns:viewmodels="clr-namespace:MAUIDemo.ViewModels"
x:Class="MAUIDemo.Views.HomePage"
Title="Home">
<ContentPage.Resources>
<Style TargetType="StackLayout" x:Key="HeaderStack">
<Setter Property="Margin" Value="20,16,20,14"/>
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="Padding" Value="20,0"/>
</Style>
<Style TargetType="Label" x:Key="SectionHeading">
<Setter Property="FontFamily" Value="NotoSerifBold"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="HorizontalOptions" Value="StartAndExpand"/>
</Style>
<Style TargetType="Label" x:Key="ShowAll">
<Setter Property="HorizontalOptions" Value="End"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="TextColor" Value="{StaticResource Primary}"/>
<Setter Property="VerticalOptions" Value="End"/>
</Style>
<Style TargetType="BoxView">
<Setter Property="HeightRequest" Value="1"/>
<Setter Property="Color" Value="#eee"/>
<Setter Property="Margin" Value="0,10,0,0"/>
</Style>
<DataTemplate x:DataType="models:Article" x:Key="ArticleTemplate">
<StackLayout Orientation="Vertical" Margin="20,0,0,0"
WidthRequest="300" HeightRequest="260">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding .}"
Command="{Binding Source={RelativeSource AncestorType={x:Type
viewmodels:HomeViewModel}}, Path=TappedCommand}"/>
</StackLayout.GestureRecognizers>
<Frame Padding="0" IsClippedToBounds="True"
BorderColor="Transparent">
<Image Source="{Binding ImageURL}" HeightRequest="180"
WidthRequest="300" Aspect="AspectFill" />
</Frame>
<Label Text="{Binding Title}" Margin="0,4,0,0" FontSize="18"
FontFamily="PoppinsSemibold" MaxLines="2"/>
<StackLayout Orientation="Horizontal" Spacing="4">
<Label Text="{Binding Category}" TextColor="{StaticResource
Primary}"/>
<Label Text="·" FontAttributes="Bold"
TextColor="{StaticResource Gray200}"/>
<Label Text="{Binding Time}" TextColor="{StaticResource
Gray200}"/>
</StackLayout>
</StackLayout>
</DataTemplate>
</ContentPage.Resources>
<ScrollView>
<VerticalStackLayout>
<StackLayout Style="{StaticResource HeaderStack}">
<Label Text="Popular tags" Style="{StaticResource
SectionHeading}"/>
<Label Text="Show All" Style="{StaticResource ShowAll}"/>
</StackLayout>

<FlexLayout BindableLayout.ItemsSource="{Binding Tags}"


Wrap="Wrap"
Margin="20,0">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame BackgroundColor="#f2f2f2"
BorderColor="Transparent"
CornerRadius="4"
Padding="8,2"
Margin="0,0,4,10">
<Label Text="{Binding .}" FontFamily="Poppins"
VerticalOptions="Center"/>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>

<BoxView />

<StackLayout Style="{StaticResource HeaderStack}">


<Label Text="Latest news" Style="{StaticResource SectionHeading}"/>
<Label Text="Show All" Style="{StaticResource ShowAll}"/>
</StackLayout>
<ScrollView Orientation="Horizontal"
HorizontalScrollBarVisibility="Never">
<StackLayout Orientation="Horizontal" Spacing="10"
BindableLayout.ItemsSource="{Binding LatestArticles}"
BindableLayout.ItemTemplate="{StaticResource ArticleTemplate}"/>
</ScrollView>

<BoxView />

<StackLayout Style="{StaticResource HeaderStack}">


<Label Text="Recommended for you" Style="{StaticResource
SectionHeading}"/>
<Label Text="Show All" Style="{StaticResource ShowAll}"/>
</StackLayout>
<ScrollView Orientation="Horizontal"
HorizontalScrollBarVisibility="Never">
<StackLayout Orientation="Horizontal" Spacing="10"
BindableLayout.ItemsSource="{Binding RecommendedArticles}"
BindableLayout.ItemTemplate="{StaticResource ArticleTemplate}"/>
</ScrollView>

<BoxView />

<StackLayout Style="{StaticResource HeaderStack}">


<Label Text="Popular articles" Style="{StaticResource
SectionHeading}"/>
<Label Text="Show All" Style="{StaticResource ShowAll}"/>
</StackLayout>
<ScrollView Orientation="Horizontal"
HorizontalScrollBarVisibility="Never">
<StackLayout Orientation="Horizontal" Spacing="10"
BindableLayout.ItemsSource="{Binding PopularArticles}"
BindableLayout.ItemTemplate="{StaticResource ArticleTemplate}"/>
</ScrollView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>-->

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy