Compare commits
89 Commits
API_UT_DEL
...
master
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 60 MiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 75 KiB |
@ -1,15 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\ApiLol\ApiLol.csproj" />
|
|
||||||
<ProjectReference Include="..\DTO\DTO.csproj" />
|
<ProjectReference Include="..\DTO\DTO.csproj" />
|
||||||
|
<ProjectReference Include="..\Model\Model.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -0,0 +1,53 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
<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>
|
@ -0,0 +1,14 @@
|
|||||||
|
<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>
|
@ -0,0 +1,142 @@
|
|||||||
|
<?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>
|
@ -0,0 +1,73 @@
|
|||||||
|
<?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>
|
@ -0,0 +1,36 @@
|
|||||||
|
<?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>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?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>
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
<?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>
|
||||||
|
|
@ -0,0 +1,185 @@
|
|||||||
|
<?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>
|
@ -0,0 +1,196 @@
|
|||||||
|
<?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>
|
@ -0,0 +1,131 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:model="clr-namespace:Model;assembly=Model"
|
||||||
|
x:Class="LolApp.ContentViews.ChampionClassSelector"
|
||||||
|
x:Name="root">
|
||||||
|
|
||||||
|
<ContentView.Resources>
|
||||||
|
<model:ChampionClass x:Key="assassin">Assassin</model:ChampionClass>
|
||||||
|
<model:ChampionClass x:Key="fighter">Fighter</model:ChampionClass>
|
||||||
|
<model:ChampionClass x:Key="mage">Mage</model:ChampionClass>
|
||||||
|
<model:ChampionClass x:Key="marksman">Marksman</model:ChampionClass>
|
||||||
|
<model:ChampionClass x:Key="support">Support</model:ChampionClass>
|
||||||
|
<model:ChampionClass x:Key="tank">Tank</model:ChampionClass>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="RadioButtonTemplate">
|
||||||
|
<Border Stroke="{StaticResource Transparent}"
|
||||||
|
BackgroundColor="{StaticResource Transparent}"
|
||||||
|
|
||||||
|
HorizontalOptions="Fill"
|
||||||
|
VerticalOptions="Fill"
|
||||||
|
Padding="0">
|
||||||
|
<Border.StrokeShape>
|
||||||
|
<RoundRectangle CornerRadius="40, 40, 0, 40"/>
|
||||||
|
</Border.StrokeShape>
|
||||||
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
<VisualStateGroupList>
|
||||||
|
<VisualStateGroup x:Name="CheckedStates">
|
||||||
|
<VisualState x:Name="Checked">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Property="BackgroundColor"
|
||||||
|
Value="{Binding CheckedColor, Source={x:Reference root}}" />
|
||||||
|
<Setter Property="Stroke"
|
||||||
|
Value="{Binding CheckedColor, Source={x:Reference root}}" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState x:Name="Unchecked">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Property="BackgroundColor"
|
||||||
|
Value="{Binding UncheckedColor, Source={x:Reference root}}" />
|
||||||
|
<Setter Property="Stroke"
|
||||||
|
Value="{Binding UncheckedColor, Source={x:Reference root}}" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
</VisualStateGroup>
|
||||||
|
</VisualStateGroupList>
|
||||||
|
</VisualStateManager.VisualStateGroups>
|
||||||
|
<Grid>
|
||||||
|
<ContentPresenter VerticalOptions="Center" HorizontalOptions="Center" />
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<Style TargetType="RadioButton">
|
||||||
|
<Setter Property="ControlTemplate"
|
||||||
|
Value="{StaticResource RadioButtonTemplate}" />
|
||||||
|
</Style>
|
||||||
|
</ContentView.Resources>
|
||||||
|
|
||||||
|
<Grid ColumnDefinitions="*, *, *" RowDefinitions="*, *"
|
||||||
|
Margin="6" ColumnSpacing="6" RowSpacing="6"
|
||||||
|
RadioButtonGroup.GroupName="championClasses"
|
||||||
|
RadioButtonGroup.SelectedValue="{Binding SelectedValue, Source={x:Reference root}, Mode=TwoWay}">
|
||||||
|
<Grid.Resources>
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="FontSize" Value="{OnPlatform Micro, WinUI=12}"/>
|
||||||
|
</Style>
|
||||||
|
</Grid.Resources>
|
||||||
|
<RadioButton Value="{Binding Source={StaticResource assassin}}">
|
||||||
|
<RadioButton.Content>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Image Source="{Binding Source={StaticResource assassin}, Converter={StaticResource championClassToIconConverter}}"
|
||||||
|
WidthRequest="26" HeightRequest="26" HorizontalOptions="Center"/>
|
||||||
|
<Label Text="Assassin" HorizontalOptions="Center"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</RadioButton.Content>
|
||||||
|
</RadioButton>
|
||||||
|
<RadioButton Grid.Column="1"
|
||||||
|
Value="{Binding Source={StaticResource fighter}}">
|
||||||
|
<RadioButton.Content>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Image Source="{Binding Source={StaticResource fighter}, Converter={StaticResource championClassToIconConverter}}"
|
||||||
|
WidthRequest="26" HeightRequest="26" HorizontalOptions="Center"/>
|
||||||
|
<Label Text="Fighter" HorizontalOptions="Center"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</RadioButton.Content>
|
||||||
|
</RadioButton>
|
||||||
|
<RadioButton Grid.Column="2"
|
||||||
|
Value="{Binding Source={StaticResource mage}}">
|
||||||
|
<RadioButton.Content>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Image Source="{Binding Source={StaticResource mage}, Converter={StaticResource championClassToIconConverter}}"
|
||||||
|
WidthRequest="26" HeightRequest="26" HorizontalOptions="Center"/>
|
||||||
|
<Label Text="Mage" HorizontalOptions="Center"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</RadioButton.Content>
|
||||||
|
</RadioButton>
|
||||||
|
<RadioButton Grid.Row="1" Grid.Column="0"
|
||||||
|
Value="{Binding Source={StaticResource marksman}}">
|
||||||
|
<RadioButton.Content>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Image Source="{Binding Source={StaticResource marksman}, Converter={StaticResource championClassToIconConverter}}"
|
||||||
|
WidthRequest="26" HeightRequest="26" HorizontalOptions="Center"/>
|
||||||
|
<Label Text="Marksman" HorizontalOptions="Center"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</RadioButton.Content>
|
||||||
|
</RadioButton>
|
||||||
|
<RadioButton Grid.Row="1" Grid.Column="1"
|
||||||
|
Value="{Binding Source={StaticResource support}}">
|
||||||
|
<RadioButton.Content>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Image Source="{Binding Source={StaticResource support}, Converter={StaticResource championClassToIconConverter}}"
|
||||||
|
WidthRequest="26" HeightRequest="26" HorizontalOptions="Center"/>
|
||||||
|
<Label Text="Support" HorizontalOptions="Center"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</RadioButton.Content>
|
||||||
|
</RadioButton>
|
||||||
|
<RadioButton Grid.Row="1" Grid.Column="2"
|
||||||
|
Value="{Binding Source={StaticResource tank}}">
|
||||||
|
<RadioButton.Content>
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<Image Source="{Binding Source={StaticResource tank}, Converter={StaticResource championClassToIconConverter}}"
|
||||||
|
WidthRequest="26" HeightRequest="26" HorizontalOptions="Center"/>
|
||||||
|
<Label Text="Tank" HorizontalOptions="Center"/>
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</RadioButton.Content>
|
||||||
|
</RadioButton>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ContentView>
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
<?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.MainPage">
|
||||||
|
|
||||||
|
<ScrollView>
|
||||||
|
<VerticalStackLayout
|
||||||
|
Spacing="25"
|
||||||
|
Padding="30,0"
|
||||||
|
VerticalOptions="Center">
|
||||||
|
|
||||||
|
<Image
|
||||||
|
Source="lollogo.jpg"
|
||||||
|
SemanticProperties.Description="Cute dot net bot waving hi to you!"
|
||||||
|
HeightRequest="200"
|
||||||
|
HorizontalOptions="Center" />
|
||||||
|
|
||||||
|
<Label
|
||||||
|
Text="League of Legends Data"
|
||||||
|
SemanticProperties.HeadingLevel="Level1"
|
||||||
|
FontSize="32"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
HorizontalTextAlignment="Center"/>
|
||||||
|
|
||||||
|
<Label
|
||||||
|
Text="Find information about champions, skins and runes"
|
||||||
|
SemanticProperties.HeadingLevel="Level2"
|
||||||
|
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
|
||||||
|
FontSize="18"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
HorizontalTextAlignment="Center"/>
|
||||||
|
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</ContentPage>
|
||||||
|
|