Add InfoTitle Page and Databinding
continuous-integration/drone/push Build is passing Details

pull/29/head
Corentin LEMAIRE 2 years ago
parent c25a43c415
commit 988f786266

@ -44,6 +44,9 @@
FontSize="20"
TextColor="white"
HorizontalTextAlignment="Center"/>
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="GoToInfoTitle"/>
</Frame.GestureRecognizers>
</Frame>
</ViewCell>
</DataTemplate>

@ -20,4 +20,16 @@ public partial class AlbumPage : ContentPage
album = (Application.Current as App).Manager.CurrentAlbum;
BindingContext = album;
}
private async void GoToInfoTitle(object sender, EventArgs e)
{
if (sender is Frame frame)
{
if (frame.BindingContext is InfoTitle infoTitle)
{
(Application.Current as App).Manager.CurrentInfoTitle = infoTitle;
}
}
await Navigation.PushAsync(new InfoTitlePage());
}
}

@ -0,0 +1,34 @@
<?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:local="clr-namespace:Linaris"
x:Class="Linaris.InfoTitlePage"
Title="InfoTitlePage">
<Grid Style="{StaticResource GridFlyoutTrigger}">
<Grid.RowDefinitions>
<RowDefinition Height="8*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<local:Layout Grid.Column="0"/>
<ScrollView Grid.Column="1" BackgroundColor="#404040">
<VerticalStackLayout>
<SearchBar Style="{StaticResource SearchBar}"/>
<Frame IsClippedToBounds="True" CornerRadius="75" HeightRequest="150" WidthRequest="150" HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="Transparent">
<Image Source="{Binding ImageURL}" Aspect="AspectFill" WidthRequest="150" HeightRequest="150" Margin="-20" IsAnimationPlaying="True"/>
</Frame>
<Label Text="{Binding Name}" Style="{StaticResource Titre}" TextColor="AntiqueWhite"/>
<Label Text="{Binding Artist}" Style="{StaticResource SousTitre}" TextColor="Goldenrod" Margin="0,0,0,20"/>
<Label Text="{Binding Description}" Style="{StaticResource SousTitre}"/>
<ScrollView BackgroundColor="gray" MinimumHeightRequest="200" Margin="50,20">
<VerticalStackLayout HorizontalOptions="Center">
<Label Text="Informations complémentaires" TextColor="{StaticResource Blue200Accent}" FontSize="16" HorizontalTextAlignment="Center" FontAttributes="Bold" HorizontalOptions="Center" Margin="0,10,0,10"/>
<Label TextColor="White" HorizontalOptions="Center" VerticalOptions="End" Text="{Binding Information}"/>
</VerticalStackLayout>
</ScrollView>
</VerticalStackLayout>
</ScrollView>
<local:FooterPage Grid.Row="1" Grid.ColumnSpan="2"/>
</Grid>
</ContentPage>

@ -0,0 +1,19 @@
using Model;
namespace Linaris;
public partial class InfoTitlePage : ContentPage
{
private InfoTitle infoTitle;
public InfoTitle InfoTitle
{
get => infoTitle;
}
public InfoTitlePage()
{
InitializeComponent();
infoTitle = (Application.Current as App).Manager.CurrentInfoTitle;
BindingContext = infoTitle;
}
}

@ -85,6 +85,9 @@
<MauiXaml Update="FooterPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="InfoTitlePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Layout.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -1,8 +1,8 @@
<?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="Linaris.PlaylistPage"
xmlns:local="clr-namespace:Linaris"
x:Class="Linaris.PlaylistPage"
Title="Playlist"
Style="{StaticResource PageFlyoutTrigger}">

@ -45,6 +45,6 @@ public class Artist
public override string ToString()
{
return $"Name : {Name}";
return $"{Name}";
}
}

@ -93,6 +93,17 @@ public class Manager
}
}
private InfoTitle? currentInfoTitle;
public InfoTitle? CurrentInfoTitle
{
get => currentInfoTitle;
set
{
currentInfoTitle = value;
}
}
public Manager(IDataManager dataManager)
{
DataManager = dataManager;
@ -105,6 +116,7 @@ public class Manager
currentAlbum = albums.FirstOrDefault();
currentPlaylist = playlists.FirstOrDefault();
currentInfoTitle = infoTitles.FirstOrDefault();
}
public void AddAlbum(Album album)

Loading…
Cancel
Save