Add classes and VerticalStackLayout style

pull/10/head
Corentin LEMAIRE 2 years ago
parent 41ba027ab5
commit 1b453ff787

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,25 @@
using Model;
// See https://aka.ms/new-console-template for more information
Album a = new Album("Adios Bahamas", "album1.jpg", "Népal");
Album a1 = new Album("Fenêtre sur Rue", "album3.jpg", "HugoTSR");
Album a2 = new Album("Dans la Légende", "album8.jpg", "PNL");
List<Album> lst = new List<Album> { a1, a2, a };
foreach (Album album in lst)
{
Console.WriteLine($"Nom de l'album : " + album.Nom);
Console.WriteLine($"Nom du fichier : " + album.File_Name);
Console.WriteLine($"Artiste : " + album.Artiste);
Console.WriteLine($"-------------------------");
}

@ -5,6 +5,10 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Linaris", "Linaris\Linaris.csproj", "{9E6281F7-95F6-472C-B268-894CE377C8A9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Connsole\Console.csproj", "{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{AA1DB94B-8273-437F-A07A-BB1F5F0D278D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -17,6 +21,14 @@ Global
{9E6281F7-95F6-472C-B268-894CE377C8A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E6281F7-95F6-472C-B268-894CE377C8A9}.Release|Any CPU.Build.0 = Release|Any CPU
{9E6281F7-95F6-472C-B268-894CE377C8A9}.Release|Any CPU.Deploy.0 = Release|Any CPU
{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}.Release|Any CPU.Build.0 = Release|Any CPU
{AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -11,7 +11,8 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout BackgroundColor="black" Spacing="20" Padding="0,20,0,0">
<ContentView Style="{StaticResource FlyoutStyle}" Grid.Column="0"></ContentView>
<!--<VerticalStackLayout BackgroundColor="black" Spacing="20" Padding="0,20,0,0">
<Button Text="Home"
x:Name="bouton"
FontSize="30"
@ -44,7 +45,7 @@
HorizontalOptions="Center"
VerticalOptions="End">
</Button>
</VerticalStackLayout>
</VerticalStackLayout>-->
<ScrollView Grid.Column="1"
BackgroundColor="#404040">

@ -7,12 +7,12 @@ public partial class AlbumPage : ContentPage
InitializeComponent();
}
async void Button_Clicked(object sender, EventArgs e)
/* async void Button_Clicked(object sender, EventArgs e)
{
var random = new Random();
var color = String.Format("#{0:X6}", random.Next(0x1000000));
bouton.BackgroundColor = Color.FromArgb(color);
await bouton.RelRotateTo(360, 1000);
bouton.Rotation = 0;
}
}*/
}

@ -4,13 +4,15 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<DataTemplate x:Key="flyout">
<VerticalStackLayout BackgroundColor="black" Spacing="20" Padding="0,20,0,0">
<ControlTemplate x:Key="flyout">
<VerticalStackLayout BackgroundColor="black" Spacing="20">
<Button Text="Home"
x:Name="bouton"
FontSize="30"
TextColor="White"
HorizontalOptions="Center"
VerticalOptions="Start">
<!--Clicked="Button_Clicked"-->
</Button>
<Button Text="Playlist"
FontSize="30"
@ -37,7 +39,11 @@
VerticalOptions="End">
</Button>
</VerticalStackLayout>
</DataTemplate>
</ControlTemplate>
<Style x:Key="FlyoutStyle" TargetType="ContentView">
<Setter Property="ControlTemplate" Value="{StaticResource flyout}"></Setter>
</Style>
<Style TargetType="ActivityIndicator">
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />

@ -0,0 +1,33 @@
namespace Model
{
public class Album
{
public string Nom { get; set; }
public string File_Name { get; set; }
public Artiste Artiste { get; set; }
public string Description { get; set; }
public string Informations { get; set; }
public IEnumerable<Morceau> Morceaux { get; set; }
public Album(string nom, string file_Name, Artiste artiste, string description, string informations)
{
Nom = nom;
File_Name = file_Name;
Artiste = artiste;
Description = description;
Informations = informations;
Morceaux = new List<Morceau>();
}
public void addMorceau(Morceau morceau)
{
Morceaux.Prepend(morceau);
}
}
}

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Artiste
{
public string Nom { get; set; }
public IEnumerable<Album> Albums { get; set; }
public Artiste(string nom)
{
Nom = nom;
Albums = new List<Album>();
}
public void addAlbum(Album album)
{
Albums.Prepend(album);
}
}
}

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Morceau
{
public string Nom { get; set; }
public string File_Name { get; set; }
public string Artiste { get; set; }
public string Description { get; set; }
public string Informations { get; set; }
public IEnumerable<Artiste> feat { get; set; }
public Morceau(string nom, string file_Name, string artiste, string description, string informations)
{
Nom = nom;
File_Name = file_Name;
Artiste = artiste;
Description = description;
Informations = informations;
feat = new List<Artiste>();
}
public void addFeat(Artiste artiste)
{
feat.Prepend(artiste);
}
}
}

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Playlist
{
public string Nom { get; set; }
public string Description { get; set; }
public IEnumerable<Morceau> Morceaux { get; set; }
public Playlist(string nom, string description)
{
Nom = nom;
Description = description;
Morceaux = new List<Morceau>();
}
public void addMorceau(Morceau morceau)
{
Morceaux.Prepend(morceau);
}
public void removeMorceau(Morceau morceau)
{
Morceaux.ToList().Remove(morceau);
}
}
}
Loading…
Cancel
Save