{"id":832,"date":"2021-03-13T20:10:37","date_gmt":"2021-03-13T11:10:37","guid":{"rendered":"https:\/\/todosoft.net\/blog\/?p=832"},"modified":"2021-03-14T05:38:25","modified_gmt":"2021-03-13T20:38:25","slug":"post-832","status":"publish","type":"post","link":"https:\/\/todosoft.net\/blog\/?p=832","title":{"rendered":"ListView\u306e\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u6642\u30fb\u9078\u629e\u6642\u306e\u8272\u3092\u6d88\u3059"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">MainWindow.xaml<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">&lt;Window x:Class=\"WpfApp8.MainWindow\"\n        xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n        xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\n        xmlns:d=\"http:\/\/schemas.microsoft.com\/expression\/blend\/2008\"\n        xmlns:mc=\"http:\/\/schemas.openxmlformats.org\/markup-compatibility\/2006\"\n        xmlns:local=\"clr-namespace:WpfApp8\"\n        mc:Ignorable=\"d\"\n        Title=\"MainWindow\" Height=\"450\" Width=\"800\">\n    &lt;Grid>\n        \n        &lt;ListView ItemsSource=\"{Binding Path=ArrayData}\">\n            &lt;ListView.ItemContainerStyle>\n                &lt;Style TargetType=\"{x:Type ListViewItem}\">\n                    \n                    &lt;!-- \u30dc\u30fc\u30c0\u30fc\u306e\u8a2d\u5b9a -->\n                    &lt;Setter Property=\"Template\">\n                        &lt;Setter.Value>\n                            &lt;ControlTemplate TargetType=\"{x:Type ContentControl}\">\n                                &lt;Border Background=\"{TemplateBinding Background}\">\n                                    &lt;ContentPresenter \/>\n                                &lt;\/Border>\n                            &lt;\/ControlTemplate>\n                        &lt;\/Setter.Value>\n                    &lt;\/Setter>\n                    \n                    &lt;!-- \u9078\u629e\u6642\u306e\u80cc\u666f\u8272 -->\n                    &lt;Style.Triggers>\n                        &lt;Trigger Property=\"IsSelected\" Value=\"True\">\n                            &lt;Setter Property=\"Background\" Value=\"Transparent\" \/>\n                        &lt;\/Trigger>\n                    &lt;\/Style.Triggers>\n                    \n                &lt;\/Style>\n            &lt;\/ListView.ItemContainerStyle>\n\n            &lt;ListView.ItemTemplate>\n                &lt;DataTemplate>\n                    &lt;TextBlock Text=\"{Binding}\"\/>\n                &lt;\/DataTemplate>\n            &lt;\/ListView.ItemTemplate>\n        &lt;\/ListView>\n\n    &lt;\/Grid>\n&lt;\/Window>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MainWindow.xaml<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,20,15],"tags":[48],"class_list":["post-832","post","type-post","status-publish","format-standard","hentry","category-c","category-wpf","category-15","tag-listview"],"_links":{"self":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=832"}],"version-history":[{"count":1,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/832\/revisions"}],"predecessor-version":[{"id":833,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/832\/revisions\/833"}],"wp:attachment":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}