From dc14329a0a83050d059025a899953d637e11a7a0 Mon Sep 17 00:00:00 2001 From: thchazot1 Date: Fri, 6 May 2022 14:17:07 +0200 Subject: [PATCH] Ce qui permet d'enlever le text dans les textboxs --- Modèle/Requin.cs | 6 +-- WpfApp1/AddAShark.xaml | 2 +- WpfApp1/MainWindow.xaml | 2 +- WpfApp1/MainWindow.xaml.cs | 13 +++++ WpfApp1/UserControlEdit.xaml | 14 +++--- WpfApp1/UserControlEdit.xaml.cs | 73 +++++++++++++++++++++++++++++ WpfApp1/userControlDescription.xaml | 2 +- test_requin/Program.cs | 10 ++-- 8 files changed, 106 insertions(+), 16 deletions(-) diff --git a/Modèle/Requin.cs b/Modèle/Requin.cs index 903d1da..bfd3017 100644 --- a/Modèle/Requin.cs +++ b/Modèle/Requin.cs @@ -25,10 +25,10 @@ namespace Modèle public string PhotoCarte { get; private set; } public Conservation StatutCons { get; private set; } public string FunFact { get; private set; } - public Zone Repartition { get; private set; } + public List Repartition { get; private set; } - public Requin(string nom, string nomSci, string description, string photo, string video, string photoCarte, Conservation statutCons, Zone repartition, string funFact) { + public Requin(string nom, string nomSci, string description, string photo, string video, string photoCarte, Conservation statutCons, List repartition, string funFact) { Nom = nom; NomSci = nomSci; Description = description; @@ -40,7 +40,7 @@ namespace Modèle FunFact = funFact; } - public Requin(string nom, string nomSci, string description, string photo, string video, string photoCarte, Conservation statutCons, Zone repartition, List funFacts) + public Requin(string nom, string nomSci, string description, string photo, string video, string photoCarte, Conservation statutCons, List repartition, List funFacts) { Random rnd = new Random(); int num = rnd.Next(funFacts.Count()); diff --git a/WpfApp1/AddAShark.xaml b/WpfApp1/AddAShark.xaml index 259915d..0ed532f 100644 --- a/WpfApp1/AddAShark.xaml +++ b/WpfApp1/AddAShark.xaml @@ -8,7 +8,7 @@ Title="AddAShark" Height="450" Width="800"> - + diff --git a/WpfApp1/MainWindow.xaml b/WpfApp1/MainWindow.xaml index 0806903..1eab044 100644 --- a/WpfApp1/MainWindow.xaml +++ b/WpfApp1/MainWindow.xaml @@ -17,7 +17,7 @@ Indien Pacifique - + diff --git a/WpfApp1/MainWindow.xaml.cs b/WpfApp1/MainWindow.xaml.cs index c1be124..b98293c 100644 --- a/WpfApp1/MainWindow.xaml.cs +++ b/WpfApp1/MainWindow.xaml.cs @@ -43,5 +43,18 @@ namespace WpfApp1 { contentControl.Content = new userControlAcceuil(); } + + private void TextBox_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e) + { + Rechercher.Text = ""; + } + + public string Recherche + { + set + { + Rechercher.Text = value; + } + } } } diff --git a/WpfApp1/UserControlEdit.xaml b/WpfApp1/UserControlEdit.xaml index 4b1a7f0..29c80fb 100644 --- a/WpfApp1/UserControlEdit.xaml +++ b/WpfApp1/UserControlEdit.xaml @@ -8,7 +8,7 @@ d:DesignHeight="450" d:DesignWidth="800"> - + @@ -25,12 +25,12 @@ - - - - - - + + + + + + diff --git a/WpfApp1/UserControlEdit.xaml.cs b/WpfApp1/UserControlEdit.xaml.cs index 36ae543..48b312d 100644 --- a/WpfApp1/UserControlEdit.xaml.cs +++ b/WpfApp1/UserControlEdit.xaml.cs @@ -24,5 +24,78 @@ namespace WpfApp1 { InitializeComponent(); } + + public string name + { + set + { + leNom.Contenu = value; + } + } + public string sciName + { + set + { + nomSci.Contenu = value; + } + } + public string pic + { + set + { + LienPhoto.Contenu = value; + } + } + public string vid + { + set + { + LienVid.Contenu = value; + } + } + public string map + { + set + { + LienMap.Contenu = value; + } + } + public string fun + { + set + { + funFact.Contenu = value; + } + } + + private void LienPhoto_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e) + { + LienPhoto.Contenu = ""; + } + + private void leNom_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e) + { + leNom.Contenu = ""; + } + + private void nomSci_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e) + { + sciName = ""; + } + + private void LienVid_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e) + { + LienVid.Contenu = ""; + } + + private void LienMap_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e) + { + LienMap.Contenu = ""; + } + + private void funFact_IsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e) + { + funFact.Contenu = ""; + } } } diff --git a/WpfApp1/userControlDescription.xaml b/WpfApp1/userControlDescription.xaml index abd3945..7b5af06 100644 --- a/WpfApp1/userControlDescription.xaml +++ b/WpfApp1/userControlDescription.xaml @@ -9,7 +9,7 @@ -