🏗️ Separate M, V, and VM

Alexis Drai 2 years ago
parent e8b1ab462b
commit b988fde827

@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283 VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AD_MAUI", "AD_MAUI\AD_MAUI.csproj", "{75950E63-4D00-4240-91D9-F4D494878A3B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AMC.View", "AMC.View\AMC.View.csproj", "{75950E63-4D00-4240-91D9-F4D494878A3B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMC.Model", "AMC.Model\AMC.Model.csproj", "{44F42419-C6A9-4926-AB9D-5BDD3786AFB3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AMC.ViewModel", "AMC.ViewModel\AMC.ViewModel.csproj", "{9A019CC9-CDD5-4A2A-A0D1-CBEB8B797A8D}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -17,6 +21,14 @@ Global
{75950E63-4D00-4240-91D9-F4D494878A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU {75950E63-4D00-4240-91D9-F4D494878A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75950E63-4D00-4240-91D9-F4D494878A3B}.Release|Any CPU.Build.0 = Release|Any CPU {75950E63-4D00-4240-91D9-F4D494878A3B}.Release|Any CPU.Build.0 = Release|Any CPU
{75950E63-4D00-4240-91D9-F4D494878A3B}.Release|Any CPU.Deploy.0 = Release|Any CPU {75950E63-4D00-4240-91D9-F4D494878A3B}.Release|Any CPU.Deploy.0 = Release|Any CPU
{44F42419-C6A9-4926-AB9D-5BDD3786AFB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44F42419-C6A9-4926-AB9D-5BDD3786AFB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44F42419-C6A9-4926-AB9D-5BDD3786AFB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44F42419-C6A9-4926-AB9D-5BDD3786AFB3}.Release|Any CPU.Build.0 = Release|Any CPU
{9A019CC9-CDD5-4A2A-A0D1-CBEB8B797A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A019CC9-CDD5-4A2A-A0D1-CBEB8B797A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A019CC9-CDD5-4A2A-A0D1-CBEB8B797A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A019CC9-CDD5-4A2A-A0D1-CBEB8B797A8D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

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

@ -1,4 +1,4 @@
namespace AD_MAUI.Model namespace AMC.Model
{ {
public class Album public class Album
{ {

@ -1,4 +1,4 @@
namespace AD_MAUI.Model namespace AMC.Model
{ {
public class Song public class Song
{ {

@ -7,16 +7,16 @@
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --> <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> --> <!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>AD_MAUI</RootNamespace> <RootNamespace>AMC.View</RootNamespace>
<UseMaui>true</UseMaui> <UseMaui>true</UseMaui>
<SingleProject>true</SingleProject> <SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<!-- Display name --> <!-- Display name -->
<ApplicationTitle>AD_MAUI</ApplicationTitle> <ApplicationTitle>Apple Music Clone</ApplicationTitle>
<!-- App Identifier --> <!-- App Identifier -->
<ApplicationId>com.companyname.ad_maui</ApplicationId> <ApplicationId>fr.uca.iut.amc.view</ApplicationId>
<ApplicationIdGuid>8fc1ba53-e1de-4aad-91d7-412badab5c89</ApplicationIdGuid> <ApplicationIdGuid>8fc1ba53-e1de-4aad-91d7-412badab5c89</ApplicationIdGuid>
<!-- Versions --> <!-- Versions -->
@ -57,13 +57,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="Views\AlbumPage.xaml"> <ProjectReference Include="..\AMC.ViewModel\AMC.ViewModel.csproj" />
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Pages\" /> <MauiXaml Update="Views\AlbumPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,8 +1,8 @@
<?xml version = "1.0" encoding = "UTF-8" ?> <?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AD_MAUI" xmlns:local="clr-namespace:AMC.View"
x:Class="AD_MAUI.App"> x:Class="AMC.View.App">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>

@ -1,4 +1,4 @@
namespace AD_MAUI; namespace AMC.View;
public partial class App : Application public partial class App : Application
{ {

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<Shell <Shell
x:Class="AD_MAUI.AppShell" x:Class="AMC.View.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AD_MAUI" xmlns:local="clr-namespace:AMC.View"
Shell.FlyoutBehavior="Disabled"> Shell.FlyoutBehavior="Disabled">
<ShellContent <ShellContent

@ -1,4 +1,4 @@
namespace AD_MAUI; namespace AMC.View;
public partial class AppShell : Shell public partial class AppShell : Shell
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="AD_MAUI.MainPage"> x:Class="AMC.View.MainPage">
<Button <Button
x:Name="RdmBtn" x:Name="RdmBtn"

@ -1,7 +1,6 @@
using AD_MAUI.ViewModel; using AMC.ViewModel;
using AD_MAUI.Views;
namespace AD_MAUI; namespace AMC.View;
public partial class MainPage : ContentPage public partial class MainPage : ContentPage
{ {

@ -1,6 +1,6 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace AD_MAUI; namespace AMC.View;
public static class MauiProgram public static class MauiProgram
{ {

@ -1,7 +1,7 @@
using Android.App; using Android.App;
using Android.Content.PM; using Android.Content.PM;
namespace AD_MAUI; namespace AMC.View;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity public class MainActivity : MauiAppCompatActivity

@ -1,7 +1,7 @@
using Android.App; using Android.App;
using Android.Runtime; using Android.Runtime;
namespace AD_MAUI; namespace AMC.View;
[Application] [Application]
public class MainApplication : MauiApplication public class MainApplication : MauiApplication

@ -1,6 +1,6 @@
using Foundation; using Foundation;
namespace AD_MAUI; namespace AMC.View;
[Register("AppDelegate")] [Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate public class AppDelegate : MauiUIApplicationDelegate

@ -1,6 +1,6 @@
using UIKit; using UIKit;
namespace AD_MAUI; namespace AMC.View;
public class Program public class Program
{ {

@ -2,7 +2,7 @@ using System;
using Microsoft.Maui; using Microsoft.Maui;
using Microsoft.Maui.Hosting; using Microsoft.Maui.Hosting;
namespace AD_MAUI; namespace AMC.View;
class Program : MauiApplication class Program : MauiApplication
{ {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages"> <manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" /> <profile name="common" />
<ui-application appid="maui-application-id-placeholder" exec="AD_MAUI.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single"> <ui-application appid="maui-application-id-placeholder" exec="AMC.View.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>maui-application-title-placeholder</label> <label>maui-application-title-placeholder</label>
<icon>maui-appicon-placeholder</icon> <icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" /> <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />

@ -1,8 +1,8 @@
<maui:MauiWinUIApplication <maui:MauiWinUIApplication
x:Class="AD_MAUI.WinUI.App" x:Class="AMC.View.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui" xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:AD_MAUI.WinUI"> xmlns:local="using:AMC.View.WinUI">
</maui:MauiWinUIApplication> </maui:MauiWinUIApplication>

@ -1,7 +1,7 @@
// To learn more about WinUI, the WinUI project structure, // To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info. // and more about our project templates, see: http://aka.ms/winui-project-info.
namespace AD_MAUI.WinUI; namespace AMC.View.WinUI;
/// <summary> /// <summary>
/// Provides application-specific behavior to supplement the default Application class. /// Provides application-specific behavior to supplement the default Application class.

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> <assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="AD_MAUI.WinUI.app"/> <assemblyIdentity version="1.0.0.0" name="AMC.View.WinUI.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3"> <application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings> <windowsSettings>

@ -1,6 +1,6 @@
using Foundation; using Foundation;
namespace AD_MAUI; namespace AMC.View;
[Register("AppDelegate")] [Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate public class AppDelegate : MauiUIApplicationDelegate

@ -1,6 +1,6 @@
using UIKit; using UIKit;
namespace AD_MAUI; namespace AMC.View;
public class Program public class Program
{ {

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 228 B

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AD_MAUI.ViewModel" xmlns:local="clr-namespace:AMC.View"
x:Class="AD_MAUI.Views.AlbumPage" xmlns:vm="clr-namespace:AMC.ViewModel;assembly=AMC.ViewModel"
x:DataType="local:AlbumViewModel"> x:Class="AMC.View.AlbumPage"
x:DataType="vm:AlbumViewModel">
<ScrollView BackgroundColor="{AppThemeBinding Light={StaticResource Background}, Dark={StaticResource BackgroundDark}}"> <ScrollView BackgroundColor="{AppThemeBinding Light={StaticResource Background}, Dark={StaticResource BackgroundDark}}">
<Grid Margin="10"> <Grid Margin="10">
@ -72,7 +73,7 @@
Margin="0,0,0,16" Margin="0,0,0,16"
Grid.Row="4"> Grid.Row="4">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate x:DataType="local:SongViewModel"> <DataTemplate x:DataType="vm:SongViewModel">
<StackLayout> <StackLayout>
<Grid Margin="0,8,0,8"> <Grid Margin="0,8,0,8">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

@ -1,6 +1,6 @@
using AD_MAUI.ViewModel; using AMC.ViewModel;
namespace AD_MAUI.Views namespace AMC.View
{ {
public partial class AlbumPage : ContentPage public partial class AlbumPage : ContentPage
{ {

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

@ -1,8 +1,8 @@
using AD_MAUI.Model; using AMC.Model;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
namespace AD_MAUI.ViewModel namespace AMC.ViewModel
{ {
public class AlbumViewModel : INotifyPropertyChanged public class AlbumViewModel : INotifyPropertyChanged
{ {

@ -1,7 +1,7 @@
using AD_MAUI.Model; using AMC.Model;
using System.ComponentModel; using System.ComponentModel;
namespace AD_MAUI.ViewModel namespace AMC.ViewModel
{ {
public class SongViewModel : INotifyPropertyChanged public class SongViewModel : INotifyPropertyChanged
{ {
Loading…
Cancel
Save