Create a Layout ContentView to data bind & Fix incorrect path music issue

pull/20/head
Corentin LEMAIRE 2 years ago
parent fabbd01efe
commit bfaff7bcab

@ -16,7 +16,8 @@
<RowDefinition Height="8*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentView Style="{StaticResource FlyoutStyle}" Grid.Column="0"></ContentView>
<local:Layout Grid.Column="0"/>
<ScrollView Grid.Column="1"
BackgroundColor="#404040">

@ -19,7 +19,8 @@ public partial class FooterPage : ContentView
// (s,a) = convention, s = sender, a = arguments, si appli fermée, on free tout
outputDevice.PlaybackStopped += PlaybackStoppedHandler;
morceauEnCours = "U:\\Utils\\Musics\\peaches.mp3";
// morceauEnCours = "Musics/peaches.mp3";
morceauEnCours = Path.Combine(AppContext.BaseDirectory, "Resources", "Musics", "winter.mp3");
audioFile = new AudioFileReader(morceauEnCours);
outputDevice.Init(audioFile);
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Linaris.Layout">
<VerticalStackLayout BackgroundColor="black" Spacing="20" Padding="0,20,0,0">
<Button Text="Home" Style="{StaticResource buttons}"/>
<Button Text="Playlists" Style="{StaticResource buttons}"/>
<Button Text="Files" Style="{StaticResource buttons}"/>
</VerticalStackLayout>
</ContentView>

@ -0,0 +1,9 @@
namespace Linaris;
public partial class Layout : ContentView
{
public Layout()
{
InitializeComponent();
}
}

@ -72,6 +72,9 @@
<MauiXaml Update="FooterPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Layout.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="LocalFilesPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
@ -86,4 +89,13 @@
</MauiXaml>
</ItemGroup>
<ItemGroup>
<None Update="Resources\Musics\peaches.mp3">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Resources\Musics\winter.mp3">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

@ -14,7 +14,7 @@
<RowDefinition Height="100"/>
</Grid.RowDefinitions>
<ContentView Style="{StaticResource FlyoutStyle}" Grid.Column="0" Grid.Row="0"></ContentView>
<local:Layout Grid.Column="0"/>
<ScrollView Grid.Column="1" Grid.Row="0" BackgroundColor="#404040">

@ -12,8 +12,8 @@
<RowDefinition Height="*"/>
<RowDefinition Height="100"/>
</Grid.RowDefinitions>
<ContentView Style="{StaticResource FlyoutStyle}" Grid.Column="0" BackgroundColor="black"></ContentView>
<local:Layout Grid.Column="0"/>
<ScrollView Grid.Column="1" BackgroundColor="#404040">

@ -15,7 +15,9 @@
<RowDefinition Height="8*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentView Style="{StaticResource FlyoutStyle}" Grid.Column="0"></ContentView>
<local:Layout Grid.Column="0"/>
<ScrollView Grid.Column="1"
BackgroundColor="#404040">
<VerticalStackLayout>

@ -12,7 +12,7 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentView Style="{StaticResource FlyoutStyle}" Grid.Column="0"></ContentView>
<local:Layout Grid.Column="0"/>
<ScrollView Grid.Column="1" BackgroundColor="#404040">

@ -18,16 +18,6 @@
<Setter Property="FontSize" Value="30"/>
</Style>
<ControlTemplate x:Key="flyout">
<VerticalStackLayout BackgroundColor="black" Spacing="20" Padding="0,20,0,0">
<Button Text="Home" Style="{StaticResource buttons}"/>
<Button Text="Playlists" Style="{StaticResource buttons}"/>
<Button Text="Files" Style="{StaticResource buttons}"/>
</VerticalStackLayout>
</ControlTemplate>
<Style x:Key="Song" TargetType="Frame">
<Setter Property="BackgroundColor" Value="CornflowerBlue"></Setter>
<Setter Property="CornerRadius" Value="10"></Setter>
@ -66,10 +56,6 @@
<Setter Property="TextColor" Value="Black"></Setter>
</Style>
<Style x:Key="FlyoutStyle" TargetType="ContentView">
<Setter Property="ControlTemplate" Value="{StaticResource flyout}"></Setter>
</Style>
<Style x:Key="pdp" TargetType="avatarview:SfAvatarView">
<Setter Property="ContentType" Value="Custom"></Setter>
<Setter Property="VerticalOptions" Value="Start"></Setter>

Loading…
Cancel
Save