{"id":564,"date":"2020-01-03T21:22:21","date_gmt":"2020-01-03T12:22:21","guid":{"rendered":"http:\/\/marius.main.jp\/software\/blog\/?p=564"},"modified":"2021-03-14T05:40:28","modified_gmt":"2021-03-13T20:40:28","slug":"post-564","status":"publish","type":"post","link":"https:\/\/todosoft.net\/blog\/?p=564","title":{"rendered":"Window\u306e\u6700\u5927\u5316\u3092\u6291\u6b62\u3059\u308b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">MainView.xaml<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">&lt;Metro:MetroWindow\n        x:Class=\"WpfApp21.View.MainView\"\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:WpfApp21.View\"\n        mc:Ignorable=\"d\"\n        Title=\"MainView\" Height=\"450\" Width=\"800\"\n\n        x:Name=\"viewMainView\"\n        xmlns:i=\"http:\/\/schemas.microsoft.com\/xaml\/behaviors\"\n        xmlns:l=\"http:\/\/schemas.livet-mvvm.net\/2011\/wpf\"\n        xmlns:vm=\"clr-namespace:WpfApp21.ViewModel\"\n        xmlns:Metro=\"clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro\"\n        ShowMaxRestoreButton=\"False\"\n        >\n\n    &lt;Window.DataContext>\n        &lt;vm:MainViewModel\/>\n    &lt;\/Window.DataContext>\n\n    &lt;i:Interaction.Triggers>\n        &lt;i:EventTrigger EventName =\"StateChanged\">\n            &lt;l:LivetCallMethodAction MethodTarget=\"{Binding}\" MethodName=\"OnStateChanged\" MethodParameter=\"{Binding ElementName=viewMainView}\" \/>\n        &lt;\/i:EventTrigger>\n    &lt;\/i:Interaction.Triggers>\n\n    &lt;Grid>\n        \n    &lt;\/Grid>\n&lt;\/Metro:MetroWindow><\/code><\/pre>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">MainViewModel.cs<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">using System.Windows;\n\nnamespace WpfApp21.ViewModel\n{\n    public class MainViewModel : Livet.ViewModel\n    {\n        public void OnStateChanged(Window window)\n        {\n            if (window.WindowState == WindowState.Maximized)\n                window.WindowState = WindowState.Normal;\n        }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MainView.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":[30,71,70],"class_list":["post-564","post","type-post","status-publish","format-standard","hentry","category-c","category-wpf","category-15","tag-window","tag-71","tag-70"],"_links":{"self":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/564","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=564"}],"version-history":[{"count":4,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/564\/revisions"}],"predecessor-version":[{"id":778,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/564\/revisions\/778"}],"wp:attachment":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}