Finish albums databinding development
continuous-integration/drone/push Build is failing Details

pull/26/head
Corentin LEMAIRE 2 years ago
parent 3beaf2a7af
commit 3777363726

@ -8,10 +8,6 @@
Style="{StaticResource PageFlyoutTrigger}">
<Grid Style="{StaticResource GridFlyoutTrigger}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="8*"/>
<RowDefinition Height="*"/>

@ -17,7 +17,7 @@
</Grid>
</HorizontalStackLayout>
<StackLayout Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalOptions="CenterAndExpand" x:Name="ButtonStack">
<StackLayout Grid.Column="1" Orientation="Horizontal" HorizontalOptions="CenterAndExpand" x:Name="ButtonStack">
<ImageButton x:Name="Random" Source="rdm.png" Margin="0,10,8,10" WidthRequest="25" HeightRequest="25" Aspect="AspectFit" MinimumWidthRequest="1" MinimumHeightRequest="1" BackgroundColor="Transparent"/>
<ImageButton x:Name="Back" Clicked="RewindButton_Clicked" Source="back.png" Margin="8,10,8,10" WidthRequest="20" HeightRequest="20" Aspect="AspectFit" MinimumWidthRequest="1" MinimumHeightRequest="1" BackgroundColor="Transparent"/>
<ImageButton x:Name="Play" Clicked="PlayButton_Clicked" Source="play.png" Margin="8,0,8,0" WidthRequest="38" HeightRequest="38" Aspect="AspectFit" MinimumWidthRequest="5" MinimumHeightRequest="5" BackgroundColor="Transparent"/>

@ -1,29 +1,29 @@
namespace Linaris;
public partial class Layout : ContentView
{
public Layout()
{
InitializeComponent();
}
namespace Linaris;
public partial class Layout : ContentView
{
public Layout()
{
InitializeComponent();
}
private async void Go_Home(object sender, EventArgs e)
{
await Navigation.PushAsync(new MainPage());
}
}
private async void Go_Playlists(object sender, EventArgs e)
{
await Navigation.PushAsync(new PlaylistsPage());
}
}
private async void Go_Back(object sender, EventArgs e)
{
await Navigation.PopAsync();
}
}
private async void Go_Files(object sender, EventArgs e)
{
await Navigation.PushAsync(new LocalFilesPage());
}
}
}

@ -24,7 +24,7 @@
<VerticalStackLayout Margin="10" Grid.ColumnSpan="2">
<Image Source="{Binding ImageURL}" Aspect="Fill" HorizontalOptions="Center" VerticalOptions="Center" HeightRequest="150" WidthRequest="150" IsAnimationPlaying="True" InputTransparent="False">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="ShowSubMenu" Command="{Binding ShowSubMenu}"/>
<TapGestureRecognizer Tapped="ShowSubMenu"/>
</Image.GestureRecognizers>
</Image>
<Label Text="{Binding Name}" Style="{StaticResource Titre}" IsVisible="{Binding IsRenaming, Converter={StaticResource InverseBooleanConverter}}" HorizontalTextAlignment="Center" WidthRequest="250" LineBreakMode="TailTruncation"/>

@ -20,79 +20,22 @@
<VerticalStackLayout>
<SearchBar Style="{StaticResource SearchBar}"/>
<FlexLayout Direction="Row" AlignItems="Start" JustifyContent="SpaceAround" Wrap="Wrap">
<VerticalStackLayout Margin="10">
<ImageButton Source="album1.jpg" SemanticProperties.Description="Album 1" Style="{StaticResource Pochette}"/>
<Label Text="Adios Bahamas" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album2.jpg" SemanticProperties.Description="Album 2" Style="{StaticResource Pochette}"/>
<Label Text="Album" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album3.jpg" SemanticProperties.Description="Album 3" Style="{StaticResource Pochette}"/>
<Label Text="Album" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album4.jpg" SemanticProperties.Description="Album 4" Style="{StaticResource Pochette}"/>
<Label Text="Album" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album5.jpg" SemanticProperties.Description="Album 5" Style="{StaticResource Pochette}"/>
<Label Text="Album" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album6.jpg" SemanticProperties.Description="Album 6" Style="{StaticResource Pochette}"/>
<Label Text="Album" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album7.png" SemanticProperties.Description="Album 7" Style="{StaticResource Pochette}"/>
<Label Text="Album" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album8.jpg" SemanticProperties.Description="Album 8" Style="{StaticResource Pochette}"/>
<Label Text="Album" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album9.jpg" SemanticProperties.Description="Album 9" Style="{StaticResource Pochette}"/>
<Label Text="Night Visions" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album10.jpg" SemanticProperties.Description="Album 10" Style="{StaticResource Pochette}"/>
<Label Text="Smoke &amp; Mirrors" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album11.jpg" SemanticProperties.Description="Album 11" Style="{StaticResource Pochette}"/>
<Label Text="Evolve" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album12.jpg" SemanticProperties.Description="Album 12" Style="{StaticResource Pochette}"/>
<Label Text="Origins" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album13.jpg" SemanticProperties.Description="Album 13" Style="{StaticResource Pochette}"/>
<Label Text="Mercury Act 1" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<VerticalStackLayout Margin="10">
<ImageButton Source="album14.jpg" SemanticProperties.Description="Album 14" Style="{StaticResource Pochette}"/>
<Label Text="Mercury Act 2" Style="{StaticResource Titre}"></Label>
</VerticalStackLayout>
<FlexLayout Direction="Row" AlignItems="Start" BindableLayout.ItemsSource="{Binding Albums}" JustifyContent="SpaceAround" Wrap="Wrap">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="2*,*">
<VerticalStackLayout Margin="10" Grid.ColumnSpan="2">
<Image Source="{Binding ImageURL}" Aspect="Fill" HorizontalOptions="Center" VerticalOptions="Center" HeightRequest="150" WidthRequest="150" IsAnimationPlaying="True" InputTransparent="False">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="GoToAlbum"/>
</Image.GestureRecognizers>
</Image>
<Label Text="{Binding Name}" Style="{StaticResource Titre}" HorizontalTextAlignment="Center" WidthRequest="250" LineBreakMode="TailTruncation"/>
</VerticalStackLayout>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>

@ -1,20 +1,26 @@
namespace Linaris;
using Model;
using System.Collections.ObjectModel;
namespace Linaris;
public partial class MainPage : ContentPage
{
private ObservableCollection<Album> albums = App.Manager.GetAlbums();
public ObservableCollection<Album> Albums
{
get => albums;
}
public MainPage()
{
InitializeComponent();
BindingContext = this;
}
async public Task Go_Home()
{
await Navigation.PushAsync(new MainPage());
}
async void GoToAlbum(object sender, EventArgs e)
{
await Navigation.PushAsync(new AlbumPage());
}
}

@ -121,7 +121,6 @@
</ColumnDefinitionCollection>
</Setter.Value>
</Setter>
<Setter Property="BackgroundColor" Value="blue"/>
</VisualState.Setters>
</VisualState>
@ -138,7 +137,6 @@
</ColumnDefinitionCollection>
</Setter.Value>
</Setter>
<Setter Property="BackgroundColor" Value="red"/>
</VisualState.Setters>
</VisualState>

@ -9,6 +9,7 @@ using static System.Reflection.Metadata.BlobBuilder;
using System.Reflection.Metadata;
using System.IO;
using System.Collections.ObjectModel;
using System.Reflection.Emit;
namespace Model.Serialization;
@ -80,7 +81,24 @@ public class LinqXmlSerialization : IDataManager
{
playlists = new ObservableCollection<Playlist>();
artists = new List<Artist>();
albums = new ObservableCollection<Album>();
Artist ImagineDragons = new Artist("Imagine Dragons");
albums = new ObservableCollection<Album>()
{
new Album("Adios Bahamas", "album1.jpg", new Artist(), "", ""),
new Album("Album2", "album2.jpg", new Artist(), "", ""),
new Album("Album3", "album3.jpg", new Artist(), "", ""),
new Album("Album4", "album4.jpg", new Artist(), "", ""),
new Album("Album5", "album5.jpg", new Artist(), "", ""),
new Album("Album6", "album6.jpg", new Artist(), "", ""),
new Album("Album7", "album7.png", new Artist(), "", ""),
new Album("Album8", "album8.jpg", new Artist(), "", ""),
new Album("Night Visions", "album9.jpg", new Artist(), "", ""),
new Album("Smoke &amp; Mirrors", "album10.jpg", new Artist(), "", ""),
new Album("Evolve", "album11.jpg", new Artist(), "", ""),
new Album("Origins", "album12.jpg", new Artist(), "", ""),
new Album("Mercury Act 1", "album13.jpg", new Artist(), "", ""),
new Album("Mercury Act 2", "album14.jpg", new Artist(), "", "")
};
infoTitles = new ObservableCollection<InfoTitle>();
customTitles = new ObservableCollection<CustomTitle>();
if (!Directory.Exists(XMLPATH))
@ -88,6 +106,7 @@ public class LinqXmlSerialization : IDataManager
Directory.CreateDirectory(XMLPATH);
}
Directory.SetCurrentDirectory(XMLPATH);
SaveAlbums();
LoadSerialization();
}

Loading…
Cancel
Save