🏗️ 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
VisualStudioVersion = 17.0.31611.283
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
Global
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.Build.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
GlobalSection(SolutionProperties) = preSolution
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
{

@ -1,4 +1,4 @@
namespace AD_MAUI.Model
namespace AMC.Model
{
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 -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>AD_MAUI</RootNamespace>
<RootNamespace>AMC.View</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
<ApplicationTitle>AD_MAUI</ApplicationTitle>
<ApplicationTitle>Apple Music Clone</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.ad_maui</ApplicationId>
<ApplicationId>fr.uca.iut.amc.view</ApplicationId>
<ApplicationIdGuid>8fc1ba53-e1de-4aad-91d7-412badab5c89</ApplicationIdGuid>
<!-- Versions -->
@ -57,13 +57,13 @@
</ItemGroup>
<ItemGroup>
<MauiXaml Update="Views\AlbumPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<ProjectReference Include="..\AMC.ViewModel\AMC.ViewModel.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Pages\" />
<MauiXaml Update="Views\AlbumPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
</Project>

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

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

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

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

@ -1,7 +1,7 @@
<?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="AD_MAUI.MainPage">
x:Class="AMC.View.MainPage">
<Button
x:Name="RdmBtn"

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

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

@ -1,7 +1,7 @@
using Android.App;
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)]
public class MainActivity : MauiAppCompatActivity

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

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

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

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

@ -1,7 +1,7 @@
<?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">
<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>
<icon>maui-appicon-placeholder</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />

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

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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<windowsSettings>

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

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

@ -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.ComponentModel;
namespace AD_MAUI.ViewModel
namespace AMC.ViewModel
{
public class AlbumViewModel : INotifyPropertyChanged
{

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