recreation VM dans lib maui

master
Mathis RIBEMONT 2 years ago
parent 8a4faeeaf8
commit c2342603c5

@ -59,12 +59,6 @@
<Folder Include="Views\Components\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LolVM\LolVM.csproj" />
<ProjectReference Include="..\Shared\Shared.csproj" />
<ProjectReference Include="..\StubLib\StubLib.csproj" />
</ItemGroup>
<ItemGroup>
<MauiXaml Update="Views\Pages\ChampionDetail.xaml">
<Generator>MSBuild:Compile</Generator>
@ -83,4 +77,8 @@
<ItemGroup>
<None Remove="Converters\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VM\VM.csproj" />
<ProjectReference Include="..\StubLib\StubLib.csproj" />
</ItemGroup>
</Project>

@ -1,5 +1,5 @@
using ClientMAUI.Views.Pages;
using LolVM;
using VM;
using Microsoft.Extensions.Logging;
using Model;
using StubLib;

@ -42,10 +42,10 @@
</CollectionView>
<Label Text="Compétences" Style="{StaticResource h3}" Padding="0,10,0,0"/>
<CollectionView ItemsSource="{Binding Skills}">
<CollectionView ItemsSource="{Binding Skills}" VerticalScrollBarVisibility="Never">
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout Padding="10">
<VerticalStackLayout Padding="0,10">
<Label Text="{Binding Name}" FontAttributes="Bold"/>
<Label Text="{Binding Description}"/>
</VerticalStackLayout>

@ -1,4 +1,4 @@
using LolVM;
using VM;
namespace ClientMAUI.Views.Pages;

@ -3,9 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ClientMAUI.Views.Pages.ChampionEditPage"
Title="ChampionEditPage">
<VerticalStackLayout>
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="Auto,*"
RowDefinitions="Auto, Auto, Auto"
RowDefinitions="Auto, Auto, Auto, Auto"
ColumnSpacing="10"
RowSpacing="5">
@ -40,4 +41,6 @@
</VerticalStackLayout>
</Grid>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,4 +1,4 @@
using LolVM;
using VM;
namespace ClientMAUI.Views.Pages;

@ -1,7 +1,6 @@
<?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:viewModels="clr-namespace:LolVM;assembly=LolVM"
x:Class="ClientMAUI.Views.Pages.ChampionListPage"
xmlns:converters="clr-namespace:ClientMAUI.Converters"
Title="Champions">

@ -1,4 +1,4 @@
using LolVM;
using VM;
namespace ClientMAUI.Views.Pages;

@ -17,10 +17,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StubLib", "StubLib\StubLib.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientMAUI", "ClientMAUI\ClientMAUI.csproj", "{4F703F7D-066A-4C0C-A9BF-50DC982B3735}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LolVM", "LolVM\LolVM.csproj", "{E88E79E8-0E3C-458D-A325-1BBCAF3D37DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LolToolkit", "LolToolkit\LolToolkit.csproj", "{FE123A96-54AF-4154-B80C-F97C1C244F68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VM", "VM\VM.csproj", "{803BE809-D28F-40F3-A43C-27FCABA63306}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -49,14 +49,14 @@ Global
{4F703F7D-066A-4C0C-A9BF-50DC982B3735}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F703F7D-066A-4C0C-A9BF-50DC982B3735}.Release|Any CPU.Build.0 = Release|Any CPU
{4F703F7D-066A-4C0C-A9BF-50DC982B3735}.Release|Any CPU.Deploy.0 = Release|Any CPU
{E88E79E8-0E3C-458D-A325-1BBCAF3D37DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E88E79E8-0E3C-458D-A325-1BBCAF3D37DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E88E79E8-0E3C-458D-A325-1BBCAF3D37DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E88E79E8-0E3C-458D-A325-1BBCAF3D37DA}.Release|Any CPU.Build.0 = Release|Any CPU
{FE123A96-54AF-4154-B80C-F97C1C244F68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE123A96-54AF-4154-B80C-F97C1C244F68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE123A96-54AF-4154-B80C-F97C1C244F68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE123A96-54AF-4154-B80C-F97C1C244F68}.Release|Any CPU.Build.0 = Release|Any CPU
{803BE809-D28F-40F3-A43C-27FCABA63306}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{803BE809-D28F-40F3-A43C-27FCABA63306}.Debug|Any CPU.Build.0 = Debug|Any CPU
{803BE809-D28F-40F3-A43C-27FCABA63306}.Release|Any CPU.ActiveCfg = Release|Any CPU
{803BE809-D28F-40F3-A43C-27FCABA63306}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

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

@ -1,20 +1,16 @@
using Model;
using System;
using System.Collections.Generic;
using System;
using Microsoft.Maui.Controls;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Model;
namespace LolVM
namespace VM
{
public class ChampionVM : INotifyPropertyChanged
{
public Champion Model
public Champion Model
{
get => _model;
set
@ -39,7 +35,7 @@ namespace LolVM
set
{
if (_model.Bio.Equals(value)) return;
_model.Bio = value;
_model.Bio = value;
OnPropertyChanged();
}
}
@ -79,7 +75,7 @@ namespace LolVM
public ICommand AddSkillCommand { get; private set; }
public string Class
public string Class
{
get => Model.Class.ToString();
}
@ -91,6 +87,7 @@ namespace LolVM
{
_skillVMs.Add(new SkillVM(s));
}
}
public event PropertyChangedEventHandler? PropertyChanged;
@ -98,4 +95,5 @@ namespace LolVM
public void OnPropertyChanged([CallerMemberName] string name = "") =>
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
}

@ -1,16 +1,11 @@
using LolToolkit;
using Model;
using System;
using System.Collections.Generic;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using LolToolkit;
namespace LolVM
namespace VM
{
public class DataManagerVM : PropertyChangedSender
public class DataManagerVM : PropertyChangedSender
{
private ObservableCollection<ChampionVM> ChampionsObs { get; set; } = new ObservableCollection<ChampionVM>();
public ReadOnlyObservableCollection<ChampionVM> ChampionVMs { get; private set; }
@ -20,7 +15,7 @@ namespace LolVM
get => _dataManager;
set
{
if(_dataManager == value) return;
if (_dataManager == value) return;
_dataManager = value;
OnPropertyChanged();
LoadData();
@ -47,3 +42,4 @@ namespace LolVM
}
}
}

@ -2,10 +2,10 @@
using LolToolkit;
using Model;
namespace LolVM
namespace VM
{
public class SkillVM : PropertyChangedSender
{
public class SkillVM : PropertyChangedSender
{
public SkillType Type { get => Model.Type; }
public Skill Model
@ -32,7 +32,7 @@ namespace LolVM
get => Model.Description;
set
{
if(value != Model.Description)
if (value != Model.Description)
{
Model.Description = value;
OnPropertyChanged();
@ -41,9 +41,9 @@ namespace LolVM
}
public SkillVM(Skill model)
{
{
this.Model = model;
}
}
}
}
}

@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- 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> -->
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LolToolkit\LolToolkit.csproj" />
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>
<ItemGroup>
<None Remove="Platforms\Android\" />
<None Remove="Platforms\iOS\" />
<None Remove="Platforms\MacCatalyst\" />
<None Remove="Platforms\Tizen\" />
<None Remove="Platforms\Windows\" />
</ItemGroup>
<ItemGroup>
<Folder Include="Platforms\Android\" />
<Folder Include="Platforms\iOS\" />
<Folder Include="Platforms\MacCatalyst\" />
<Folder Include="Platforms\Tizen\" />
<Folder Include="Platforms\Windows\" />
</ItemGroup>
</Project>
Loading…
Cancel
Save