Advertisement
Guest User

MW.XAML.CS

a guest
Oct 15th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using DataBindingPart2.MVVM;
  16.  
  17. namespace DataBindingPart2
  18. {
  19. /// <summary>
  20. /// Logique d'interaction pour MainWindow.xaml
  21. /// </summary>
  22. public partial class MainWindow : Window
  23. {
  24.  
  25. public Client Monclient { get; set; }
  26.  
  27. public List<getClients_Result> ClientList { get; set; } //Déclarer la liste ici
  28. public GetInfoCLients_Result currentClient { get; set; }
  29. public MVVMClients mmvmClient { get; set; }
  30.  
  31.  
  32.  
  33. public MainWindow()
  34. {
  35. //ClientList = new List<Client>(); //Implémenter la new list ici
  36. //this.DataContext = this; //MAUVAISE IDEE VRAIMENT DE LA MERDE
  37. //Monclient = new Client { Nom = "Kelly", Prenom = "Diotte", Localite = "Mikonos" };
  38. //ClientList.Add(new Client { Nom = "Benoit", Prenom = "Nawrot", Localite = "Wiers" });
  39. //ClientList.Add(new Client { Nom = "Warlock", Prenom = "Tarmino", Localite = "Kalimdor" });
  40.  
  41. ClientEntities CltE = new ClientEntities();
  42.  
  43. ClientList = CltE.getClients().ToList();
  44. //currentClient = new getClients_Result();
  45. mmvmClient = new MVVMClients();
  46. InitializeComponent();
  47. }
  48.  
  49.  
  50.  
  51.  
  52. private void ClientList_SelectionChanged(object sender, SelectionChangedEventArgs e)
  53. {
  54.  
  55. ListBox lb = sender as ListBox;
  56. var Client = lb.SelectedItem as getClients_Result;
  57. ClientEntities clientEntities1 = new ClientEntities();
  58. mmvmClient.currentClient = clientEntities1.GetInfoCLients(Client.Clientid).First();
  59. }
  60.  
  61.  
  62.  
  63.  
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement