Compare commits
No commits in common. 'master' and 'Documentation_UT_Client' have entirely different histories.
master
...
Documentat
@ -1,89 +0,0 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: LolProject
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
volumes:
|
||||
- name: docs
|
||||
path: /docs
|
||||
commands:
|
||||
- cd src/EntityFramework_LoL/Sources/
|
||||
- dotnet restore LeagueOfLegendsCI.sln
|
||||
- dotnet build LeagueOfLegendsCI.sln -c Release --no-restore
|
||||
- dotnet publish LeagueOfLegendsCI.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||
|
||||
- name: tests
|
||||
image: mcr.microsoft.com/dotnet/sdk:6.0
|
||||
commands:
|
||||
- cd src/EntityFramework_LoL/Sources/
|
||||
- dotnet restore LeagueOfLegendsCI.sln
|
||||
- dotnet test LeagueOfLegendsCI.sln --no-restore
|
||||
depends_on: [build]
|
||||
|
||||
- name: code-analysis
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
|
||||
commands:
|
||||
- cd src/EntityFramework_LoL/Sources/
|
||||
- dotnet restore LeagueOfLegendsCI.sln
|
||||
- dotnet sonarscanner begin /k:LolProjectIUT /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**,DbManager/**,Client/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||
- dotnet build LeagueOfLegendsCI.sln -c Release --no-restore
|
||||
- dotnet test LeagueOfLegendsCI.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
|
||||
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
||||
- dotnet publish LeagueOfLegendsCI.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
|
||||
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||
secrets: [ SECRET_SONAR_LOGIN ]
|
||||
settings:
|
||||
# accessible en ligne de commande par ${PLUGIN_SONAR_HOST}
|
||||
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||
# accessible en ligne de commande par ${PLUGIN_SONAR_TOKEN}
|
||||
sonar_token:
|
||||
from_secret: SECRET_SONAR_LOGIN
|
||||
depends_on: [tests]
|
||||
# docker image build
|
||||
|
||||
- name: docker-build-and-push
|
||||
image: plugins/docker
|
||||
settings:
|
||||
dockerfile: src/EntityFramework_LoL/Sources/ApiLol/Dockerfile
|
||||
context: src/EntityFramework_LoL/Sources/
|
||||
registry: hub.codefirst.iut.uca.fr
|
||||
repo: hub.codefirst.iut.uca.fr/emre.kartal/lolproject
|
||||
username:
|
||||
from_secret: SECRET_REGISTRY_USERNAME
|
||||
password:
|
||||
from_secret: SECRET_REGISTRY_PASSWORD
|
||||
|
||||
# container deployment
|
||||
- name: deploy-container
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
environment:
|
||||
IMAGENAME: hub.codefirst.iut.uca.fr/emre.kartal/lolproject:latest
|
||||
CONTAINERNAME: lolApi
|
||||
COMMAND: create
|
||||
OVERWRITE: true
|
||||
depends_on: [ docker-build-and-push ]
|
||||
|
||||
- name: generate-and-deploy-docs
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
|
||||
failure: ignore
|
||||
volumes:
|
||||
- name: docs
|
||||
path: /docs
|
||||
commands:
|
||||
#- cd Documentation/doxygen
|
||||
#- doxygen Doxyfile
|
||||
- /entrypoint.sh
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
depends_on: [ build ]
|
||||
|
||||
#volumes:
|
||||
#- name: docs
|
||||
# temp: {}
|
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 60 MiB |
Before Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 176 KiB |
Before Width: | Height: | Size: 75 KiB |
@ -1,25 +0,0 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
@ -1,26 +0,0 @@
|
||||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["ApiLol/ApiLol.csproj", "ApiLol/"]
|
||||
COPY ["StubLib/StubLib.csproj", "StubLib/"]
|
||||
COPY ["Model/Model.csproj", "Model/"]
|
||||
COPY ["Shared/Shared.csproj", "Shared/"]
|
||||
COPY ["DTO/DTO.csproj", "DTO/"]
|
||||
RUN dotnet restore "ApiLol/ApiLol.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/ApiLol"
|
||||
RUN dotnet build "ApiLol.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "ApiLol.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "ApiLol.dll"]
|
@ -1,53 +0,0 @@
|
||||
using DTO;
|
||||
using Model;
|
||||
|
||||
namespace ApiMapping.enums
|
||||
{
|
||||
public static class ChampionClassMapper
|
||||
{
|
||||
public static ChampionClassDto ToDto(this ChampionClass championClass)
|
||||
{
|
||||
switch (championClass)
|
||||
{
|
||||
case ChampionClass.Unknown:
|
||||
return ChampionClassDto.Unknown;
|
||||
case ChampionClass.Assassin:
|
||||
return ChampionClassDto.Assassin;
|
||||
case ChampionClass.Fighter:
|
||||
return ChampionClassDto.Fighter;
|
||||
case ChampionClass.Mage:
|
||||
return ChampionClassDto.Mage;
|
||||
case ChampionClass.Marksman:
|
||||
return ChampionClassDto.Marksman;
|
||||
case ChampionClass.Support:
|
||||
return ChampionClassDto.Support;
|
||||
case ChampionClass.Tank:
|
||||
return ChampionClassDto.Tank;
|
||||
default:
|
||||
return ChampionClassDto.Unknown;
|
||||
}
|
||||
}
|
||||
public static ChampionClass ToModel(this ChampionClassDto championClass)
|
||||
{
|
||||
switch (championClass)
|
||||
{
|
||||
case ChampionClassDto.Unknown:
|
||||
return ChampionClass.Unknown;
|
||||
case ChampionClassDto.Assassin:
|
||||
return ChampionClass.Assassin;
|
||||
case ChampionClassDto.Fighter:
|
||||
return ChampionClass.Fighter;
|
||||
case ChampionClassDto.Mage:
|
||||
return ChampionClass.Mage;
|
||||
case ChampionClassDto.Marksman:
|
||||
return ChampionClass.Marksman;
|
||||
case ChampionClassDto.Support:
|
||||
return ChampionClass.Support;
|
||||
case ChampionClassDto.Tank:
|
||||
return ChampionClass.Tank;
|
||||
default:
|
||||
return ChampionClass.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ApiMapping\ApiMapping.csproj" />
|
||||
<ProjectReference Include="..\DTO\DTO.csproj" />
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,14 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ApiLol\ApiLol.csproj" />
|
||||
<ProjectReference Include="..\DTO\DTO.csproj" />
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,14 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Model\Model.csproj" />
|
||||
<ProjectReference Include="..\MyFlib\MyFlib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,142 +0,0 @@
|
||||
<?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:vm="clr-namespace:LolApp.ViewModels"
|
||||
xmlns:myviews="clr-namespace:LolApp.ContentViews"
|
||||
xmlns:appvm="clr-namespace:LolApp.ViewModels"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="LolApp.AddChampionPage"
|
||||
Title="AddChampionPage"
|
||||
x:Name="root">
|
||||
<Grid RowDefinitions="Auto,*, Auto" BackgroundColor="{StaticResource Black}">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Nouveau Champion" IsVisible="{Binding IsNew}"
|
||||
Style="{StaticResource title}"/>
|
||||
<Label Text="Modifier le Champion" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"
|
||||
Style="{StaticResource title}"/>
|
||||
<Grid><Line Stroke="{StaticResource Primary}"
|
||||
X1="0" Y1="0" X2="200" Y2="0"
|
||||
HorizontalOptions="Center"/>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
<ScrollView Grid.Row="1">
|
||||
<Grid ColumnDefinitions="*, 3*" RowDefinitions="Auto, Auto, Auto, 162, 162, Auto, Auto, Auto, Auto">
|
||||
<Label Text="Nom :"
|
||||
Style="{StaticResource labelForEntry}"/>
|
||||
<Entry Grid.Column="1" Placeholder="Nom du champion" Text="{Binding Champion.Name}"
|
||||
Style="{StaticResource defaultEntry}"
|
||||
IsEnabled="{Binding IsNew}"/>
|
||||
|
||||
<Label Text="Icone :" Grid.Row="1" Style="{StaticResource labelForEntry}"/>
|
||||
<ImageButton Grid.Row="1" Grid.Column="1" HeightRequest="42" WidthRequest="42"
|
||||
Source="{Binding Champion.IconBase64, TargetNullValue='lol.png',
|
||||
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||
BackgroundColor="{StaticResource Secondary}"
|
||||
HorizontalOptions="Start"
|
||||
Margin="6"
|
||||
Command="{Binding PickIconCommand}"/>
|
||||
<Label Text="Image :" Grid.Row="2" Style="{StaticResource labelForEntry}"/>
|
||||
<Grid Grid.Row="2" Grid.Column="1" x:Name="largeImageGrid" Margin="0, 0, 12, 0">
|
||||
<ImageButton WidthRequest="{Binding Width, Source={x:Reference largeImageGrid}}"
|
||||
HeightRequest="150"
|
||||
Source="{Binding Champion.LargeImageBase64, TargetNullValue='lollogo.jpg',
|
||||
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||
BackgroundColor="{StaticResource Secondary}"
|
||||
HorizontalOptions="Start"
|
||||
Margin="6"
|
||||
Command="{Binding PickLargeImageCommand}"/>
|
||||
</Grid>
|
||||
<Label Text="Bio :" Grid.Row="3"
|
||||
Style="{StaticResource labelForEntry}"/>
|
||||
<Editor Grid.Column="1" Grid.Row="3"
|
||||
Text="{Binding Champion.Bio}" Style="{StaticResource defaultEditor}"/>
|
||||
<Label Text="Classe :" Grid.Row="4"
|
||||
Style="{StaticResource labelForEntry}"/>
|
||||
<myviews:ChampionClassSelector Grid.Row="4" Grid.Column="1" MaximumWidthRequest="{OnPlatform WinUI=400}"
|
||||
CheckedColor="{StaticResource Primary}"
|
||||
UncheckedColor="{StaticResource Secondary}"
|
||||
SelectedValue="{Binding Champion.ChampionClass, Mode=TwoWay}"/>
|
||||
<Label Text="Caractéristiques :" Grid.Row="5" Grid.RowSpan="2"
|
||||
Style="{StaticResource labelForEntry}" VerticalOptions="Start"/>
|
||||
<Border Stroke="{StaticResource Secondary}" Grid.Row="5" Grid.Column="1" VerticalOptions="FillAndExpand"> <ListView ItemsSource="{Binding Champion.Characteristics}"
|
||||
Margin="6" HeightRequest="100" HorizontalOptions="Fill" VerticalOptions="Fill"
|
||||
BackgroundColor="{StaticResource Black}" SeparatorColor="{StaticResource Secondary}" >
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<ViewCell.ContextActions>
|
||||
<MenuItem Command="{Binding Source={x:Reference root}, Path=BindingContext.RemoveCharacteristicCommand}"
|
||||
CommandParameter="{Binding .}"
|
||||
IsDestructive="True" Text="Delete"/>
|
||||
</ViewCell.ContextActions>
|
||||
<Border Margin="0,4" BackgroundColor="{StaticResource Secondary}">
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="10, 10, 0, 10"/>
|
||||
</Border.StrokeShape>
|
||||
<Grid ColumnDefinitions="*, Auto">
|
||||
<Label Text="{Binding Key}" TextColor="{StaticResource Black}"
|
||||
HorizontalOptions="Start" VerticalOptions="Center" Margin="4, 0, 0, 0"/>
|
||||
<Label Text="{Binding Value}" Grid.Column="1" TextColor="{StaticResource Black}"
|
||||
HorizontalOptions="End" VerticalOptions="Center" Margin="0, 0, 4, 0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Border>
|
||||
<Grid Grid.Column="1" Grid.Row="6" ColumnDefinitions="*, 58, Auto">
|
||||
<Entry Style="{StaticResource defaultEntry}" Placeholder="Caractéristique" Text="{Binding NewCharacteristicDescription}"/>
|
||||
<Entry Style="{StaticResource defaultEntry}" Placeholder="Valeur" Grid.Column="1" Text="{Binding NewCharacteristicValue}" Keyboard="Numeric">
|
||||
<Entry.Behaviors>
|
||||
<toolkit:NumericValidationBehavior Flags="ValidateOnValueChanged"
|
||||
MinimumValue="0"
|
||||
MaximumValue="9999999"
|
||||
MaximumDecimalPlaces="0"
|
||||
InvalidStyle="{StaticResource InvalidEntryStyle}"
|
||||
ValidStyle="{StaticResource defaultEntry}"/>
|
||||
</Entry.Behaviors>
|
||||
</Entry>
|
||||
<Button Grid.Column="2" Margin="4,8" CornerRadius="22"
|
||||
Text="{StaticResource plus}"
|
||||
Command="{Binding AddCharacteristicCommand}"/>
|
||||
</Grid>
|
||||
<Label Style="{StaticResource labelForEntry}" Text="Compétences :" Grid.Row="7" VerticalOptions="Start"/>
|
||||
<Grid Grid.Row="7" Grid.Column="1" ColumnDefinitions="*, Auto">
|
||||
<ListView ItemsSource="{Binding Champion.Skills}" Margin="6"
|
||||
HeightRequest="100" HorizontalOptions="Fill" VerticalOptions="Fill" HasUnevenRows="True"
|
||||
BackgroundColor="{StaticResource Black}" SeparatorColor="{StaticResource Secondary}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Grid RowDefinitions="Auto, Auto, *">
|
||||
<Grid.Resources>
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="TextColor" Value="{StaticResource Primary}"/>
|
||||
</Style>
|
||||
|
||||
</Grid.Resources>
|
||||
<Label Text="{Binding Name}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"/>
|
||||
<Label Text="{Binding Type}" Grid.Row="1" VerticalOptions="Center" FontAttributes="Italic" FontSize="Micro"/>
|
||||
<Label Text="{Binding Description}" FontSize="Micro" FontAttributes="Italic"
|
||||
Grid.Row="2"/>
|
||||
</Grid>
|
||||
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
<Button Grid.Column="1" Margin="4,8" CornerRadius="22"
|
||||
Text="{StaticResource plus}" VerticalOptions="Start"
|
||||
Command="{Binding AddSkillCommand}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ScrollView>
|
||||
<HorizontalStackLayout Grid.Row="2" HorizontalOptions="Center" Spacing="40" Margin="0, 10, 0, 20">
|
||||
<Button Text="Ajouter" Command="{Binding AddChampionCommand}" IsVisible="{Binding IsNew}"/>
|
||||
<Button Text="Modifier" Command="{Binding EditChampionCommand}" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"/>
|
||||
<Button Text="Annuler" Command="{Binding CancelCommand}"/>
|
||||
</HorizontalStackLayout>
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
@ -1,73 +0,0 @@
|
||||
<?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="LolApp.AddOrEditSkinPage"
|
||||
Title="AddOrEditSkinPage"
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit">
|
||||
<Grid RowDefinitions="Auto,*, Auto" BackgroundColor="{StaticResource Black}">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Nouveau Skin" IsVisible="{Binding IsNew}"
|
||||
Style="{StaticResource title}"/>
|
||||
<Label Text="Modifier le Skin" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"
|
||||
Style="{StaticResource title}"/>
|
||||
<Grid><Line Stroke="{StaticResource Primary}"
|
||||
X1="0" Y1="0" X2="200" Y2="0"
|
||||
HorizontalOptions="Center"/>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
<ScrollView Grid.Row="1">
|
||||
<Grid ColumnDefinitions="*, 3*" RowDefinitions="Auto, Auto, Auto, Auto, 162">
|
||||
<Label Text="Nom :"
|
||||
Style="{StaticResource labelForEntry}"/>
|
||||
<Entry Grid.Column="1" Placeholder="Nom du skin" Text="{Binding Skin.Name}"
|
||||
Style="{StaticResource defaultEntry}"
|
||||
IsEnabled="{Binding IsNew}"/>
|
||||
|
||||
<Label Text="Icone :" Grid.Row="1" Style="{StaticResource labelForEntry}"/>
|
||||
<ImageButton Grid.Row="1" Grid.Column="1" HeightRequest="42" WidthRequest="42"
|
||||
Source="{Binding Skin.IconBase64, TargetNullValue='lol.png',
|
||||
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||
BackgroundColor="{StaticResource Secondary}"
|
||||
HorizontalOptions="Start"
|
||||
Margin="6"
|
||||
Command="{Binding PickIconCommand}"/>
|
||||
<Label Text="Image :" Grid.Row="2" Style="{StaticResource labelForEntry}"/>
|
||||
<Grid Grid.Row="2" Grid.Column="1" x:Name="largeImageGrid" Margin="0, 0, 12, 0">
|
||||
<ImageButton WidthRequest="{Binding Width, Source={x:Reference largeImageGrid}}"
|
||||
HeightRequest="150"
|
||||
Source="{Binding Skin.LargeImageBase64, TargetNullValue='lollogo.jpg',
|
||||
Converter={StaticResource base64ToImageSourceConverter}}"
|
||||
BackgroundColor="{StaticResource Secondary}"
|
||||
HorizontalOptions="Start"
|
||||
Margin="6"
|
||||
Command="{Binding PickLargeImageCommand}"/>
|
||||
</Grid>
|
||||
<Label Text="Prix :" Grid.Row="3"
|
||||
Style="{StaticResource labelForEntry}"/>
|
||||
<HorizontalStackLayout Grid.Column="1" Grid.Row="3" Margin="6">
|
||||
<Image Source="rp.png" HeightRequest="16" WidthRequest="16"/>
|
||||
<Entry Grid.Column="1" Placeholder="Nom du skin" Text="{Binding Skin.Price}"
|
||||
Style="{StaticResource defaultEntry}" Margin="4, 0, 0, 0" HorizontalTextAlignment="Start">
|
||||
<Entry.Behaviors>
|
||||
<toolkit:NumericValidationBehavior Flags="ValidateOnValueChanged"
|
||||
MinimumValue="0"
|
||||
MaximumValue="9999999"
|
||||
MaximumDecimalPlaces="0"
|
||||
InvalidStyle="{StaticResource InvalidEntryStyle}"
|
||||
ValidStyle="{StaticResource defaultEntry}"/>
|
||||
</Entry.Behaviors>
|
||||
</Entry>
|
||||
</HorizontalStackLayout>
|
||||
<Label Text="Description :" Grid.Row="4"
|
||||
Style="{StaticResource labelForEntry}"/>
|
||||
<Editor Grid.Column="1" Grid.Row="4"
|
||||
Text="{Binding Skin.Description}" Style="{StaticResource defaultEditor}"/>
|
||||
</Grid>
|
||||
</ScrollView>
|
||||
<HorizontalStackLayout Grid.Row="2" HorizontalOptions="Center" Spacing="40" Margin="0, 10, 0, 20">
|
||||
<Button Text="Ajouter" Command="{Binding AddSkinCommand}" IsVisible="{Binding IsNew}"/>
|
||||
<Button Text="Modifier" Command="{Binding EditSkinCommand}" IsVisible="{Binding IsNew, Converter={StaticResource invertedBoolConverter}}"/>
|
||||
<Button Text="Annuler" Command="{Binding CancelCommand}"/>
|
||||
</HorizontalStackLayout>
|
||||
</Grid>
|
||||
</ContentPage>
|
@ -1,36 +0,0 @@
|
||||
<?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="LolApp.AddSkill"
|
||||
xmlns:appvm="clr-namespace:LolApp.ViewModels"
|
||||
Title="AddSkill">
|
||||
<Grid RowDefinitions="Auto,*, Auto" BackgroundColor="{StaticResource Gray900}">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Nouvelle Compétence"
|
||||
Style="{StaticResource title}"/>
|
||||
<Grid>
|
||||
<Line Stroke="{StaticResource Primary}"
|
||||
X1="0" Y1="0" X2="200" Y2="0"
|
||||
HorizontalOptions="Center"/>
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
<ScrollView Grid.Row="1">
|
||||
<Grid ColumnDefinitions="*, 3*" RowDefinitions="Auto, Auto, *">
|
||||
<Label Text="Nom :" Style="{StaticResource labelForEntry}"/>
|
||||
<Entry Text="{Binding Name}" Style="{StaticResource defaultEntry}"
|
||||
Grid.Column="1"/>
|
||||
<Label Text="Type :" Style="{StaticResource labelForEntry}" Grid.Row="1"/>
|
||||
<Picker ItemsSource="{Binding AllSkills}" SelectedItem="{Binding SkillType}"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Style="{StaticResource defaultPicker}"/>
|
||||
<Label Text="Description :" Style="{StaticResource labelForEntry}" Grid.Row="2"/>
|
||||
<Editor Grid.Row="2" Grid.Column="1" Text="{Binding Description}"
|
||||
Style="{StaticResource defaultEditor}"/>
|
||||
</Grid>
|
||||
</ScrollView>
|
||||
<HorizontalStackLayout Grid.Row="2" HorizontalOptions="Center" Spacing="40" Margin="0, 10, 0, 20">
|
||||
<Button Text="Ajouter" Command="{Binding AddSkillToChampionCommand}"/>
|
||||
<Button Text="Annuler" Command="{Binding CancelCommand}"/>
|
||||
</HorizontalStackLayout>
|
||||
</Grid>
|
||||
</ContentPage>
|
@ -1,18 +0,0 @@
|
||||
<?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:LolApp"
|
||||
x:Class="LolApp.App">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Resources/Styles/FontAwesomeGlyphs.xaml" x:Name="Colors" />
|
||||
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
|
||||
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
|
||||
<ResourceDictionary Source="Resources/Styles/MyStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Shell
|
||||
x:Class="LolApp.AppShell"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:LolApp"
|
||||
Shell.FlyoutBehavior="Disabled">
|
||||
<TabBar>
|
||||
<ShellContent
|
||||
Title="Home"
|
||||
ContentTemplate="{DataTemplate local:MainPage}"
|
||||
Route="MainPage"
|
||||
Icon="{OnPlatform 'lol.png'}" />
|
||||
<ShellContent
|
||||
Title="Champions"
|
||||
ContentTemplate="{DataTemplate local:ChampionsPage}"
|
||||
Route="Championspage"
|
||||
Icon="{OnPlatform 'sword.png'}" />
|
||||
</TabBar>
|
||||
</Shell>
|
||||
|
@ -1,185 +0,0 @@
|
||||
<?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:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
x:Class="LolApp.ChampionPage"
|
||||
Title="ChampionPage"
|
||||
x:Name="root"
|
||||
BackgroundColor="Black">
|
||||
<ContentPage.ToolbarItems>
|
||||
<ToolbarItem Text="Modifier" Command="{Binding AppVM.NavigateToEditChampionPageCommand, Source={x:Reference root}}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</ContentPage.ToolbarItems>
|
||||
<ScrollView>
|
||||
<VerticalStackLayout>
|
||||
<AbsoluteLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
|
||||
MaximumHeightRequest="{OnPlatform WinUI=300}"
|
||||
HeightRequest="{Binding Width,
|
||||
Source={RelativeSource AncestorType={x:Type ContentPage}},
|
||||
Converter={StaticResource imageRatioConverter},
|
||||
ConverterParameter={StaticResource imageRatio}}">
|
||||
<Image Source="{Binding Image, Converter={StaticResource base64ToImageSourceConverter}}"
|
||||
Aspect="AspectFit"
|
||||
AbsoluteLayout.LayoutBounds="0,0,1,1"
|
||||
AbsoluteLayout.LayoutFlags="All"
|
||||
MaximumHeightRequest="{OnPlatform WinUI=300}"/>
|
||||
</AbsoluteLayout>
|
||||
|
||||
|
||||
<Grid Padding="10" BackgroundColor="{StaticResource Black}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Text="{Binding Name}" FontAttributes="Bold" TextColor="{StaticResource Primary}"
|
||||
FontSize="Title"/>
|
||||
<VerticalStackLayout Grid.Column="1" HorizontalOptions="Center">
|
||||
<Image Source="{Binding Class, Converter={StaticResource championClassToIconConverter}}"
|
||||
HeightRequest="26" WidthRequest="26" x:Name="imgClass" PropertyChanged="imgClass_PropertyChanged">
|
||||
<Image.Behaviors>
|
||||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"
|
||||
x:Name="tintColor"/>
|
||||
</Image.Behaviors>
|
||||
</Image>
|
||||
<Label Text="{Binding Class}" TextColor="{StaticResource Primary}"
|
||||
FontSize="Micro"/>
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
|
||||
|
||||
<ScrollView VerticalScrollBarVisibility="Always" BackgroundColor="Black" >
|
||||
|
||||
<Label Text="{Binding Bio}" TextColor="{StaticResource Primary}" Padding="10" FontAttributes="Italic"/>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<Label Padding="10" Text="Caractéristiques" FontSize="Title" TextColor="{StaticResource Primary}"
|
||||
BackgroundColor="Black"/>
|
||||
|
||||
<Grid MaximumHeightRequest="240">
|
||||
<Grid.Resources>
|
||||
<x:Double x:Key="gridHeight">120</x:Double>
|
||||
<x:Int32 x:Key="nbCellsPerLine">3</x:Int32>
|
||||
</Grid.Resources>
|
||||
<Grid.HeightRequest>
|
||||
<MultiBinding Converter="{StaticResource multiMathExpressionConverter}"
|
||||
ConverterParameter="ceiling(x1/x2)*x0">
|
||||
<Binding Source="{StaticResource gridHeight}"/>
|
||||
<Binding Path="Characteristics.Count"/>
|
||||
<Binding Source="{StaticResource nbCellsPerLine}"/>
|
||||
</MultiBinding>
|
||||
</Grid.HeightRequest>
|
||||
<CollectionView ItemsSource="{Binding Characteristics}"
|
||||
ItemsLayout="VerticalGrid, 3"
|
||||
VerticalScrollBarVisibility="Always">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Padding="10" HeightRequest="120">
|
||||
<Border Stroke="{StaticResource PrimaryBrush}" StrokeThickness="2" BackgroundColor="{StaticResource Black}">
|
||||
<Grid RowDefinitions="4*,3*">
|
||||
<Label Text="{Binding Key}" HorizontalOptions="Center" TextColor="{StaticResource Primary}"
|
||||
FontSize="Small" FontAttributes="Bold" VerticalOptions="End" HorizontalTextAlignment="Center"
|
||||
Margin="0, 0, 0, 5"/>
|
||||
<Label Grid.Row="1" Text="{Binding Value}" HorizontalOptions="Center" TextColor="{StaticResource Primary}"
|
||||
VerticalOptions="Start" HorizontalTextAlignment="Center"
|
||||
FontSize="Small"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
</CollectionView.ItemTemplate>
|
||||
|
||||
</CollectionView>
|
||||
</Grid>
|
||||
<Label Padding="10" Text="Compétences" FontSize="Title" TextColor="{StaticResource Primary}"
|
||||
BackgroundColor="Black"/>
|
||||
<ListView ItemsSource="{Binding Skills}" Margin="10"
|
||||
BackgroundColor="Black" HasUnevenRows="True" VerticalScrollBarVisibility="Always"
|
||||
MaximumHeightRequest="400">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="TextColor" Value="{StaticResource Primary}"/>
|
||||
</Style>
|
||||
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Text="{Binding Name}" FontSize="Medium" FontAttributes="Bold" VerticalOptions="Center"/>
|
||||
<Label Text="{Binding Type}" Grid.Column="1" VerticalOptions="Center" FontAttributes="Italic" FontSize="Micro"/>
|
||||
<Label Text="{Binding Description}" FontSize="Micro" FontAttributes="Italic"
|
||||
Grid.ColumnSpan="2" Grid.Row="1"/>
|
||||
</Grid>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
|
||||
</ListView.ItemTemplate>
|
||||
|
||||
</ListView>
|
||||
<Grid ColumnDefinitions="*, Auto">
|
||||
<Label Padding="10" Text="Skins" FontSize="Title" TextColor="{StaticResource Primary}"
|
||||
BackgroundColor="Black"/>
|
||||
<Button Grid.Column="1" Text="{StaticResource plus}" CornerRadius="22" BackgroundColor="{StaticResource Primary}"
|
||||
TextColor="{StaticResource Black}" FontSize="Header"
|
||||
Command="{Binding AppVM.NavigateToAddNewSkinPageCommand, Source={x:Reference root}}"
|
||||
CommandParameter="{Binding}"
|
||||
VerticalOptions="Center" HorizontalOptions="Center"
|
||||
Margin="6"/>
|
||||
</Grid>
|
||||
|
||||
|
||||
<ListView BindingContext="{Binding AppVM, Source={x:Reference root}}"
|
||||
ItemsSource="{Binding SkinsMgrVM.Skins}" HasUnevenRows="True"
|
||||
BackgroundColor="{StaticResource Black}"
|
||||
x:Name="listSkins">
|
||||
<ListView.Behaviors>
|
||||
<toolkit:EventToCommandBehavior
|
||||
EventName="ItemSelected"
|
||||
Command="{Binding NavigateToSkinDetailsPageCommand}"
|
||||
EventArgsConverter="{StaticResource SelectedItemEventArgsConverter}"
|
||||
/>
|
||||
|
||||
</ListView.Behaviors>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<ViewCell.ContextActions>
|
||||
<MenuItem IsDestructive="True"
|
||||
Text="Supprimer"
|
||||
Command="{Binding BindingContext.SkinsMgrVM.DeleteSkinCommand, Source={x:Reference listSkins}}"
|
||||
CommandParameter="{Binding .}"/>
|
||||
<MenuItem Text="Modifier"
|
||||
Command="{Binding Source={x:Reference listSkins}, Path=BindingContext.NavigateToEditSkinPageCommand}"
|
||||
CommandParameter="{Binding .}"/>
|
||||
</ViewCell.ContextActions>
|
||||
<Border Stroke="{StaticResource Primary}" Padding="8,4" HeightRequest="60" Margin="4"
|
||||
StrokeThickness="3" BackgroundColor="{StaticResource Black}">
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="0, 10, 10, 10"/>
|
||||
</Border.StrokeShape>
|
||||
<HorizontalStackLayout VerticalOptions="Center">
|
||||
<Image Source="{Binding Icon, Converter={StaticResource base64ToImageSourceConverter}}"
|
||||
HeightRequest="46" WidthRequest="46"/>
|
||||
<Label Text="{Binding Name}" TextColor="{StaticResource Primary}" FontSize="Small"
|
||||
VerticalOptions="Center" Margin="10,4"/>
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
|
||||
</ListView>
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
|
||||
</ContentPage>
|
@ -1,196 +0,0 @@
|
||||
<?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:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
xmlns:myviews="clr-namespace:LolApp.ContentViews"
|
||||
xmlns:vm="clr-namespace:ViewModels;assembly=ViewModels"
|
||||
xmlns:appvm="clr-namespace:LolApp.ViewModels"
|
||||
x:Class="LolApp.ChampionsPage"
|
||||
Title="Champions"
|
||||
x:Name="root">
|
||||
<ContentPage.ToolbarItems>
|
||||
<ToolbarItem Text="Ajouter" Command="{Binding AppVM.NavigateToAddNewChampionPageCommand}" />
|
||||
</ContentPage.ToolbarItems>
|
||||
<ContentPage.Resources>
|
||||
<ControlTemplate x:Key="searchByStringControl">
|
||||
<Grid Margin="20,4" HeightRequest="{OnPlatform 30, Android=40}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Entry Placeholder="{TemplateBinding PlaceHolder}"
|
||||
Text="{TemplateBinding Text, Mode=TwoWay}"/>
|
||||
<Button Text="{StaticResource magnifying-glass}"
|
||||
FontFamily="FASolid"
|
||||
Grid.Column="1" Margin="4, 0, 0, 0"
|
||||
Command="{TemplateBinding Command}"
|
||||
CommandParameter="{TemplateBinding CommandParameter}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
</ContentPage.Resources>
|
||||
<ContentPage.Behaviors>
|
||||
<toolkit:EventToCommandBehavior
|
||||
EventName = "Loaded"
|
||||
Command="{Binding AppVM.ChampionsMgrVM.LoadChampionsCommand}"/>
|
||||
|
||||
</ContentPage.Behaviors>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<toolkit:Expander Grid.Row="1">
|
||||
<toolkit:Expander.Header>
|
||||
<HorizontalStackLayout>
|
||||
<Label Text="Chercher par "
|
||||
HorizontalOptions="Center"/>
|
||||
<Label Text="nom" IsVisible="{Binding VM.SearchedName, Converter={StaticResource isStringNotNullOrWhiteSpaceConverter}}"/>
|
||||
<Label Text="compétence" IsVisible="{Binding VM.SearchedSkill, Converter={StaticResource isStringNotNullOrWhiteSpaceConverter}}"/>
|
||||
<Label Text=" "/>
|
||||
<Label Text="{Binding IsExpanded,
|
||||
Source={RelativeSource AncestorType={x:Type toolkit:Expander}},
|
||||
Converter={StaticResource isExpandedToCaretConverter}}"
|
||||
FontFamily="FASolid"
|
||||
VerticalOptions="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
</toolkit:Expander.Header>
|
||||
<VerticalStackLayout HorizontalOptions="Fill" BackgroundColor="WhiteSmoke">
|
||||
<myviews:SearchByStringView ControlTemplate="{StaticResource searchByStringControl}"
|
||||
PlaceHolder="Entrez un nom"
|
||||
Text="{Binding VM.SearchedName, Mode=TwoWay}"
|
||||
Command="{Binding AppVM.ChampionsMgrVM.LoadChampionsByNameCommand}"
|
||||
CommandParameter="{Binding VM.SearchedName}"/>
|
||||
<myviews:SearchByStringView ControlTemplate="{StaticResource searchByStringControl}"
|
||||
PlaceHolder="Entrez une compétence"
|
||||
Text="{Binding VM.SearchedSkill, Mode=TwoWay}"
|
||||
Command="{Binding AppVM.ChampionsMgrVM.LoadChampionsBySkillCommand}"
|
||||
CommandParameter="{Binding VM.SearchedSkill}"/>
|
||||
<myviews:SearchByStringView ControlTemplate="{StaticResource searchByStringControl}"
|
||||
PlaceHolder="Entrez une caractéristique"
|
||||
Text="{Binding VM.SearchedCharacteristic, Mode=TwoWay}"
|
||||
Command="{Binding AppVM.ChampionsMgrVM.LoadChampionsByCharacteristicCommand}"
|
||||
CommandParameter="{Binding VM.SearchedCharacteristic}"/>
|
||||
<Label Text="Filtrer par classe :" Margin="20, 4, 0, 0"
|
||||
FontSize="Micro"/>
|
||||
<CollectionView ItemsSource="{x:Static appvm:ChampionClassVM.Classes}" ItemsLayout="VerticalGrid, 3"
|
||||
SelectionMode="Single" HeightRequest="110" x:Name="classesView"
|
||||
SelectionChangedCommand="{Binding AppVM.ChampionsMgrVM.LoadChampionsByClassCommand}"
|
||||
SelectionChangedCommandParameter="{Binding VM.SelectedItem, Source={RelativeSource Self}}"
|
||||
SelectedItem="{Binding VM.SelectedClass, Source={x:Reference root}, Mode=TwoWay}">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid HorizontalOptions="Center" RowDefinitions="*, *" WidthRequest="100" Padding="10, 10, 10, 0"
|
||||
BackgroundColor="{Binding IsSelected, Converter={StaticResource isSelectedToColorConverter}}">
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding Source={x:Reference root}, Path=BindingContext.VM.SelectedChampionClassChangedCommand}"
|
||||
CommandParameter="{Binding}" />
|
||||
|
||||
</Grid.GestureRecognizers>
|
||||
<Image Source="{Binding Model, Converter={StaticResource championClassToIconConverter}}" HeightRequest="26" WidthRequest="26"
|
||||
/>
|
||||
<Label Text="{Binding Model}" TextColor="{StaticResource Black}"
|
||||
HorizontalOptions="Center" Grid.Row="1"
|
||||
FontSize="Micro">
|
||||
</Label>
|
||||
|
||||
</Grid>
|
||||
|
||||
</DataTemplate>
|
||||
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
</VerticalStackLayout>
|
||||
</toolkit:Expander>
|
||||
<ListView Grid.Row="2" CachingStrategy="RecycleElementAndDataTemplate"
|
||||
ItemsSource="{Binding AppVM.ChampionsMgrVM.Champions}"
|
||||
RowHeight="50"
|
||||
SelectedItem="{Binding AppVM.ChampionsMgrVM.SelectedChampion, Mode=TwoWay}">
|
||||
<ListView.Behaviors>
|
||||
<toolkit:EventToCommandBehavior
|
||||
EventName="ItemSelected"
|
||||
Command="{Binding AppVM.NavigateToChampionDetailsPageCommand}"
|
||||
EventArgsConverter="{StaticResource SelectedItemEventArgsConverter}"
|
||||
/>
|
||||
|
||||
</ListView.Behaviors>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<ViewCell.ContextActions>
|
||||
<MenuItem Command="{Binding Source={x:Reference root}, Path=BindingContext.AppVM.ChampionsMgrVM.DeleteChampionCommand}"
|
||||
CommandParameter="{Binding .}"
|
||||
IsDestructive="True" Text="Supprimer"/>
|
||||
<MenuItem Command="{Binding Source={x:Reference root}, Path=BindingContext.AppVM.NavigateToEditChampionPageCommand}"
|
||||
CommandParameter="{Binding .}"
|
||||
IsDestructive="False" Text="Modifier"/>
|
||||
</ViewCell.ContextActions>
|
||||
<Grid Margin="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="{Binding Icon, Converter={StaticResource base64ToImageSourceConverter}}"
|
||||
HeightRequest="40"
|
||||
WidthRequest="40"
|
||||
Grid.RowSpan="2"
|
||||
VerticalOptions="Center"
|
||||
Margin="0, 0, 10, 0"/>
|
||||
<Label Text="{Binding Name}" Grid.Column="1"
|
||||
FontAttributes="Bold"
|
||||
FontSize="{OnPlatform Header, WinUI=Small}"
|
||||
VerticalOptions="Center"/>
|
||||
<Label Text="{Binding Class}" Grid.Row="1" Grid.Column="1"
|
||||
FontAttributes="Italic"
|
||||
FontSize="Caption"
|
||||
VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
<Grid Grid.Row="3" HorizontalOptions="Center" HeightRequest="45"
|
||||
IsVisible="{Binding AppVM.ChampionsMgrVM.NbChampions, Converter={StaticResource intToBoolConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0" Style="{StaticResource iconButton}"
|
||||
Command="{Binding AppVM.ChampionsMgrVM.PreviousPageCommand}">
|
||||
<Button.ImageSource>
|
||||
<FontImageSource Glyph="{StaticResource angle-left}"
|
||||
FontFamily="FASolid"
|
||||
Size="Title"/>
|
||||
</Button.ImageSource>
|
||||
</Button>
|
||||
<StackLayout Orientation="Horizontal" Grid.Column="1"
|
||||
HorizontalOptions="Center" VerticalOptions="Center">
|
||||
<StackLayout.Resources>
|
||||
<Style BasedOn="{StaticResource defaultLabel}" TargetType="Label">
|
||||
<Setter Property="Margin" Value="2"/>
|
||||
</Style>
|
||||
</StackLayout.Resources>
|
||||
<Label Text="{Binding AppVM.ChampionsMgrVM.Index, Converter={StaticResource plusOneConverter}}" HorizontalOptions="End"/>
|
||||
<Label Text="/"/>
|
||||
<Label Text="{Binding AppVM.ChampionsMgrVM.NbPages}" HorizontalOptions="Start"/>
|
||||
</StackLayout>
|
||||
<Button Grid.Column="2" Style="{StaticResource iconButton}"
|
||||
Command="{Binding AppVM.ChampionsMgrVM.NextPageCommand}">
|
||||
<Button.ImageSource>
|
||||
<FontImageSource Glyph="{StaticResource angle-right}" FontFamily="FASolid"
|
||||
Size="Title"/>
|
||||
</Button.ImageSource>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ContentPage>
|