-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.xaml
50 lines (45 loc) · 2.45 KB
/
MainPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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"
x:Class="TimesNewsApp.MainPage"
xmlns:model="clr-namespace:TimesNewsApp.Models"
xmlns:viewmodel="clr-namespace:TimesNewsApp.ViewModels"
x:DataType="viewmodel:PopularMoviePageViewModel"
BackgroundColor="{DynamicResource Light}"
Title="{Binding Title}">
<Grid Margin="0,32,0,0">
<CollectionView ItemsSource="{Binding Movie}"
Grid.ColumnSpan="2"
SelectionMode="Single"
SelectedItem="{Binding SelectedMovieItem}"
SelectionChangedCommand="{Binding SelectionChangedCommand}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:Result">
<Grid Padding="10">
<Frame Style="{StaticResource CardView}">
<Grid Padding="0" RowDefinitions="200,*">
<Image Source="{Binding poster_path, StringFormat= 'https://image.tmdb.org/t/p/original/{0}'}"
Grid.Row="0"
Aspect="AspectFill"
WidthRequest="150"
HeightRequest="225"/>
<StackLayout
Grid.Row="1"
Padding="10"
VerticalOptions="Center">
<Label Text="{Binding title}" Style="{StaticResource TitleLabelStyle}"/>
</StackLayout>
</Grid>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<ActivityIndicator IsVisible="{Binding IsBusy}"
IsRunning="{Binding IsBusy}"
HorizontalOptions="FillAndExpand"
VerticalOptions="CenterAndExpand"
Grid.RowSpan="2"
Grid.ColumnSpan="2"/>
</Grid>
</ContentPage>