{"id":483,"date":"2016-07-17T11:50:22","date_gmt":"2016-07-17T02:50:22","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2016\/07\/17\/wpf_2\/"},"modified":"2016-07-17T11:50:22","modified_gmt":"2016-07-17T02:50:22","slug":"wpf_2","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2016\/07\/17\/wpf_2\/","title":{"rendered":"WPF \u30c7\u30fc\u30bf\u30b0\u30ea\u30c3\u30c9\u9078\u629e\u3055\u308c\u305f\u884c\u306b\u5bfe\u5fdc\u3059\u308b\u30e2\u30c7\u30eb\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p>[<a href=\"http:\/\/typea.info\/tips\/wiki.cgi?page=WPF+Tips\"><u>WPF Tips<\/u><\/a>]<\/p>\n<p><a href=\"http:\/\/typea.info\/products\/shikalog.html\">WPF \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4f5c\u6210\u3067\u5f97\u305fTips\u3092\u30e1\u30e2<\/a>\u3002<\/p>\n<p> <a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/4798114200\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=4798114200&amp;linkCode=as2&amp;tag=typea09-22\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=4798114200&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\" \/><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=4798114200\" width=\"1\" height=\"1\" \/>   <\/p>\n<h2>1.\u72b6\u6cc1<\/h2>\n<p>\u30c7\u30fc\u30bf\u30b0\u30ea\u30c3\u30c9\u3067\u9078\u629e\u3055\u308c\u305f\u884c\u306b\u5bfe\u5fdc\u3059\u308b\u30e2\u30c7\u30eb\u3092\u53d6\u5f97\u3059\u308b\u3002<\/p>\n<h2>2.\u5bfe\u5fdc<\/h2>\n<p>SelectionChanged \u30a4\u30d9\u30f3\u30c8\u306e\u30cf\u30f3\u30c9\u30e9\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<h2>3.\u53c2\u8003<\/h2>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1027360\/datagridview-capturing-user-row-selection\">DataGridView capturing user row selection<\/a> <\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/16822956\/getting-wpf-data-grid-context-menu-click-row\">Getting WPF Data Grid Context Menu Click Row<\/a> <\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/22868445\/wpf-binding-selecteditems-in-mvvm\">WPF Binding SelectedItems in MVVM<\/a> <\/li>\n<li><a href=\"http:\/\/sorceryforce.com\/visualstudio\/executefileiconchange.html\">\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30a4\u30b3\u30f3\u306e\u5909\u66f4<\/a> <\/li>\n<\/ul>\n<h2>4.\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p>Shop\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ea\u30b9\u30c8\u3068\u30d0\u30a4\u30f3\u30c9\u3057\u305f\u30c7\u30fc\u30bf\u30b0\u30ea\u30c3\u30c9\u306eSelectionChanged\u30a4\u30d9\u30f3\u30c8\u3092\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/p>\n<pre class=\"prettyprint linenums\">&lt;DataGrid x:Name=&quot;dgrdShops&quot;  ItemsSource=&quot;{Binding Shops}&quot; SelectionChanged=&quot;dgrdShops_SelectionChanged&quot;&gt;\r\n    :\r\n&lt;\/DataGrid&gt;<\/pre>\n<p>ViewModel\u306eSelectedShops \u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u9078\u629e\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30bb\u30c3\u30c8\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">private void dgrdShops_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)\r\n{\r\n    ViewModel.SelectedShops.Clear();\r\n    foreach (var item in dgrdShops.SelectedItems)\r\n    {\r\n        var shop = item as Shop;\r\n        if (shop != null) {\r\n            ViewModel.SelectedShops.Add(shop);\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u4ee5\u4e0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[WPF Tips] WPF \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4f5c\u6210\u3067\u5f97\u305fTips\u3092\u30e1\u30e2\u3002 1.\u72b6\u6cc1 \u30c7\u30fc\u30bf\u30b0\u30ea\u30c3\u30c9\u3067\u9078\u629e\u3055\u308c\u305f\u884c\u306b\u5bfe\u5fdc\u3059\u308b\u30e2\u30c7\u30eb\u3092\u53d6\u5f97\u3059\u308b\u3002 2.\u5bfe\u5fdc SelectionChanged \u30a4\u30d9\u30f3\u30c8\u306e\u30cf\u30f3\u30c9\u30e9\u3092\u8a18\u8ff0\u3059\u308b\u3002 3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[93],"tags":[],"class_list":["post-483","post","type-post","status-publish","format-standard","hentry","category-wpf"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=483"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/483\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}