{"id":550,"date":"2011-08-20T23:50:12","date_gmt":"2011-08-20T23:50:12","guid":{"rendered":"http:\/\/nestor.nestasoft.fr\/?p=550"},"modified":"2011-08-20T23:52:57","modified_gmt":"2011-08-20T23:52:57","slug":"part-1-childwindow-silverlight-ouverture-et-rechargement-de-la-listbox-apres-fermeture","status":"publish","type":"post","link":"https:\/\/nestasoft.fr\/?p=550","title":{"rendered":"Part 1 : ChildWindow (Silverlight) : Ouverture et rechargement de la ListBox apr\u00e8s fermeture"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignleft\" src=\"http:\/\/www.nestor.nestasoft.fr\/wp-content\/uploads\/2011\/07\/silverlight.bmp\"\/><br \/>\nBonjour.<br \/>\nNous d\u00e9couvrirons dans ce billet comment ouvrir une fen\u00eatre fille et charger certains contr\u00f4les de la fen\u00eatre m\u00e8re apr\u00e8s ferm\u00e9ture de la fen\u00eatre fille.<br \/>\nAre you ready, let&rsquo;s go \ud83d\ude42<br \/>\n<!--more--><\/p>\n<p>Soit deux classes: <\/p>\n<ul>\n<li>Administration<\/li>\n<li>AjoutUtilisateur (une ChildWindows)<\/li>\n<\/ul>\n<p>Voici le code \u00e0 ins\u00e9rer dans le code behind de la page Administration.xaml.cs de le m\u00e9thode <b>btnCreateUser_Click<\/b>:<\/p>\n<pre class=\"brush:csharp\"> \r\n\/\/Ouvre la f\u00e9n\u00eatre de cr\u00e9ation d'un utilisateur\r\nprivate void btnCreateUser_Click(object sender, System.Windows.RoutedEventArgs e)\r\n{\r\n     CreationUtilisateur cw = new CreationUtilisateur ();\r\n     cw.Closed += new EventHandler(w_Closed);\r\n     cw.Show();\r\n}\r\n<\/pre>\n<p>une fois notre utilisateur cr\u00e9er, nous allons recharger la liste des utilisateurs. Pour se faire nous devons d\u00e9finir l&rsquo;\u00e9v\u00e8nement de fermeture de la fen\u00eatre.<\/p>\n<pre class=\"brush:csharp\">\r\n        void w_Closed(object sender, EventArgs e)\r\n        {\r\n            \r\n            \/\/ on est cool alors on se d\u00e9sabonne\r\n            var cw = sender as CreationUtilisateur ;\r\n            if (cw != null)\r\n                cw.Closed -= new EventHandler(w_Closed);\r\n\r\n            \/\/ c'est ferm\u00e9 alors on rafraichit notre liste des utilisateurs\r\n            _viewModel.LoadUsers();\r\n        }<\/pre>\n<p>Ici s&rsquo;ach\u00e8ve notre premi\u00e8re partie.<br \/>\nDans la partie deux nous allons d\u00e9finir la m\u00e9thode LoadUser() de notre ViewModel.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_550\" class=\"pvc_stats all  \" data-element-id=\"550\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/nestasoft.fr\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bonjour. Nous d\u00e9couvrirons dans ce billet comment ouvrir une fen\u00eatre fille et charger certains contr\u00f4les de la fen\u00eatre m\u00e8re apr\u00e8s ferm\u00e9ture de la fen\u00eatre fille. Are you ready, let&rsquo;s go \ud83d\ude42<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_550\" class=\"pvc_stats all  \" data-element-id=\"550\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/nestasoft.fr\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-550","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=550"}],"version-history":[{"count":10,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":558,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts\/550\/revisions\/558"}],"wp:attachment":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}