LE BINDING FONCTIONNE YEAAAHHH 🎉 Y a plus qu'a Binder les infos du monstre dans la vue
continuous-integration/drone/push Build is passing Details

pull/32/head
Nicolas BLONDEAU 2 years ago
parent 697c9fd23b
commit afa14c1b14

@ -414,7 +414,7 @@ string rechercheMonstre()
}
//menuAccueil();
menuAccueil();
User auteur = new User("pseudo", "nom", "prenom", "mdp", new List<Monstre> { });
// Création d'un monstre
@ -424,8 +424,4 @@ Monstre monstre = new Monstre(1, "Dragon", "Dangereux", "Un redoutable dragon cr
Conseil conseil = new Conseil(auteur, "Soyez prudent lors de votre rencontre avec le dragon.", monstre);
// Affichage du conseil
/*conseil.affichConseil();
menuAccueil();*/
Monstre uiui = new Monstre(1, "Poule", "passif", "Je suis un animal présent un peu partout, sauf dans le desert car il fait beaucoup trop chaud. Mais j'aime beaucoup la jungle !", new List<string> { "Quand une poule est tué il y a 3.12% de chance que la poule laisse tomber un oeuf " }, new List<string> { "Apparence1", "App2", "App3" }, new List<Conseil> { });
Console.WriteLine(uiui.ImageLink);
// conseil.affichConseil();

@ -79,7 +79,7 @@ namespace Model
}
private string mdp;
[DataMember]
[DataMember(Order = 5)]
public List<Monstre>? monstresDejaVu { get; private set; }
public User(string pseudo, string nom, string prenom, string mdp, List<Monstre>? monstresVus = null)

@ -22,7 +22,7 @@ namespace Persistance
/// </summary>
public class LoaderXml : IUserDataManager, IMonsterDataManager
{
static string path = "/Saves/";
static string path = "../../../../Persistance/saves/";
static string fichierUserXML = "users.xml";
static string fichierMonstreXML = "monsters.xml";

@ -94,7 +94,7 @@ namespace Persistance
public UserManager(IUserDataManager dataMngr) {
Pers = dataMngr;
ListUsers = new LoaderXml().loadUsers(); //CHOIX ICI DE LA METHODE DE CHARGEMENT INITIAL DES UTILISATEURS
ListUsers = new LoaderStub().loadUsers(); //CHOIX ICI DE LA METHODE DE CHARGEMENT INITIAL DES UTILISATEURS
}
}
}

@ -74,11 +74,15 @@
Clicked="Inscription_Clicked"
Style="{StaticResource buttonStyle}"
Text="Créer un compte" />
<Button
Clicked="Invite_Clicked"
<Label
Style="{StaticResource labelStyleBottom}"
Text="Me connecter plus tard"
HeightRequest="20" />
HeightRequest="20">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="Invite_Clicked"/>
</Label.GestureRecognizers>
</Label>
<!--IMAGE SORTIE APPLI A FAIRE - EXIT avec porte style minecraft-->
</FlexLayout>

@ -1,4 +1,6 @@
namespace Vues
using System.Windows.Input;
namespace Vues
{
public partial class Accueil : ContentPage
{

@ -1,12 +1,24 @@
using Model;
using Persistance;
using System.ComponentModel;
namespace Vues
{
public partial class App : Application
{
public MonsterManager monsterManager { get; private set; } = new MonsterManager(new LoaderStub());
public Monstre MonstreSelectionne {
get
{
return monstreSelectionne;
}
set
{
monstreSelectionne = value;
OnPropertyChanged("MonstreSelectionne");
}
}
private Monstre monstreSelectionne;
public App()
{
InitializeComponent();

@ -13,17 +13,32 @@
PlaceholderColor="DimGray"
CancelButtonColor="DimGray"/>
</HorizontalStackLayout>
<ListView ItemsSource="{Binding ListMonsters}" Grid.Row="1">
<ListView x:Name="ListV" ItemsSource="{Binding ListMonsters}" Grid.Row="1" ItemTapped="OnClick">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<VerticalStackLayout>
<ImageButton Source="{Binding ImageLink}"/>
<Image Source="{Binding ImageLink}"/>
</VerticalStackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
<Grid Grid.Column="1" RowDefinitions="*,*,*,*" BindingContext="{Binding SelectedItem, Source={x:Reference ListV}}">
<Label Text="{Binding Name}"/>
<HorizontalStackLayout>
<!-- Image du mob -->
<Image Source="{Binding ImageLink}" MaximumHeightRequest="400"/>
<!-- Caractéristiques -->
<Frame Margin="40">
<Label
Text="{Binding Description, StringFormat=Description : \{0\}}"
FontSize="Medium">
</Label>
</Frame>
</HorizontalStackLayout>
</Grid>
</Grid>
</ContentPage>

@ -10,4 +10,9 @@ public partial class SearchMob : ContentPage
BindingContext = (Application.Current as App).monsterManager;
}
public void OnClick(object sender, ItemTappedEventArgs e)
{
(App.Current as App).MonstreSelectionne = e.Item as Monstre;
}
}
Loading…
Cancel
Save