{"id":671,"date":"2021-03-25T20:59:52","date_gmt":"2021-03-25T11:59:52","guid":{"rendered":"https:\/\/roundwide.com\/?p=671"},"modified":"2021-05-26T17:44:25","modified_gmt":"2021-05-26T08:44:25","slug":"migrate-to-mahapps-2-x","status":"publish","type":"post","link":"https:\/\/roundwide.com\/ja\/migrate-to-mahapps-2-x\/","title":{"rendered":"MahApps.Metro 2.x\u3078\u306e\u79fb\u884c\u4f5c\u696d"},"content":{"rendered":"\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30c4\u30fc\u30eb<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/fujieda\/BurageSnap\" data-type=\"URL\" data-id=\"https:\/\/github.com\/fujieda\/BurageSnap\" target=\"_blank\">BurageSnap<\/a>\u306b\u304a\u3051\u308b<a href=\"https:\/\/mahapps.com\/\" data-type=\"URL\" data-id=\"https:\/\/mahapps.com\/\">MahApps.Metro<\/a> 1.3.0\u304b\u30892.4.3\u3078\u306e\u79fb\u884c\u4f5c\u696d\u3092\u7d39\u4ecb\u3059\u308b\u3002BurageSnap\u3067\u306f\u4ee5\u4e0b\u306e\u5c0f\u3055\u306a\u30d5\u30c3\u30c8\u30d7\u30ea\u30f3\u30c8\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u3001MahApps.Metro\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"169\" height=\"114\" src=\"https:\/\/roundwide.com\/wp-content\/uploads\/2021\/03\/BurageSnap.png\" alt=\"\" class=\"wp-image-675\"\/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">\u30c6\u30fc\u30de\u306e\u4fee\u6b63<\/h2>\n\n\n\n<p>\u6700\u521d\u306b\u30c6\u30fc\u30de\u306e\u8a2d\u5b9a\u3092\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e<a href=\"https:\/\/mahapps.com\/docs\/guides\/migration-to-v2.0\" data-type=\"URL\" data-id=\"https:\/\/mahapps.com\/docs\/guides\/migration-to-v2.0\" target=\"_blank\" rel=\"noreferrer noopener\">Migration to v2.0<\/a>\u306b\u5f93\u3063\u3066\u5909\u66f4\u3057\u305f\u3002<\/p>\n\n\n\nOld\n<script type=\"text\/plain\" class=\"language-xml\"><ResourceDictionary Source=\"pack:\/\/application:,,,\/MahApps.Metro;component\/Styles\/Controls.xaml\" \/>\n<ResourceDictionary Source=\"pack:\/\/application:,,,\/MahApps.Metro;component\/Themes\/MetroWindow.xaml\" \/>\n<ResourceDictionary Source=\"pack:\/\/application:,,,\/MahApps.Metro;component\/Styles\/Colors.xaml\" \/>\n<ResourceDictionary Source=\"pack:\/\/application:,,,\/MahApps.Metro;component\/Styles\/Accents\/Steel.xaml\" \/>\n<ResourceDictionary Source=\"pack:\/\/application:,,,\/MahApps.Metro;component\/Styles\/Accents\/BaseLight.xaml\" \/>\n<\/script>\nNew\n<script type=\"text\/plain\" class=\"lang-xml\"><ResourceDictionary Source=\"pack:\/\/application:,,,\/MahApps.Metro;component\/Styles\/Controls.xaml\"\/>\n<ResourceDictionary Source=\"pack:\/\/application:,,,\/MahApps.Metro;component\/styles\/Themes\/light.steel.xaml\"\/>\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30bf\u30a4\u30eb\u306e\u4fee\u6b63<\/h2>\n\n\n\n<p>\u305d\u308c\u304b\u3089\u3001\u4ee5\u4e0b\u306e<code>MetroWindow<\/code>\u306e\u30b9\u30bf\u30a4\u30eb\u8a2d\u5b9a\u3092\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002MahApps 2.x\u306e<code>MetroWindow<\/code>\u306f\u3001\u3053\u308c\u3089\u306e\u52d5\u7684\u30ea\u30bd\u30fc\u30b9\u3068\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6301\u3063\u3066\u3044\u306a\u3044\u3002<\/p>\n\n\n\n<pre><code class=\"lang-xml\">&lt;Style x:Key=\"WindowStyle\" TargetType=\"mah:MetroWindow\"&gt;\n...\n    &lt;Setter Property=\"BorderBrush\" Value=\"{<mark>DynamicResource AccentColorBrush<\/mark>}\"\/&gt;\n    &lt;Setter Property=\"<mark>TitlebarHeight<\/mark>\" Value=\"24\"\/&gt;\n    &lt;Setter Property=\"<mark>TitleCaps<\/mark>\" Value=\"False\"\/&gt;\n    &lt;Setter Property=\"<mark>WindowMinButtonStyle<\/mark>\" Value=\"{StaticResource WindowButtonStyle}\"\/&gt;\n    &lt;Setter Property=\"<mark>WindowCloseButtonStyle<\/mark>\" Value=\"{StaticResource WindowButtonStyle}\"\/&gt;\n...\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">AccentColorBrush<\/h3>\n\n\n\n<p>\u540c\u3058\u30d6\u30e9\u30b7\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u53c2\u7167\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308c\u3070\u3088\u3044\u3002<\/p>\n\n\n\n<script type=\"text\/plain\" class=\"lang-xml\"><Setter Property=\"BorderBrush\" Value=\"{StaticResource MahApps.Brushes.Accent}\"\/><\/script>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a6\u30a3\u30f3\u30c9\u30a6\u30bf\u30a4\u30c8\u30eb<\/h3>\n\n\n\n<p><code>TitlebarHeight<\/code>\u306f\u5358\u7d14\u306b<code>TitleBarHeight<\/code>\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u305f\u3002<code>TitleCaps<\/code>\u306f<code>TitleCharacterCasing<\/code>\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u305f\u304c\u3001\u5024\u306f<a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.windows.controls.charactercasing?view=net-5.0\">CharcterCasing <\/a>\u578b\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u305f\u3002<\/p>\n\n\n\n<pre><code class=\"lang-xml\">&lt;Setter Property=\"TitleBarHeight\"Value=\"24\"&gt;\n&lt;Setter Property=\"TitleCharacterCasing\" Value=\"Normal\"\/&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a6\u30a3\u30f3\u30c9\u30a6\u30dc\u30bf\u30f3<\/h3>\n\n\n\n<p><code>WindowMinButtonStyle<\/code>\u3068<code>WindowCloseButtonStyle<\/code>\u306e\u30b9\u30bf\u30a4\u30eb\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u3001\u6700\u5c0f\u5316\u30dc\u30bf\u30f3\u3068\u9589\u3058\u308b\u30dc\u30bf\u30f3\u3092\u5c0f\u3055\u304f\u3059\u308b\u305f\u3081\u306b\u4f7f\u3063\u3066\u305f\u304cMahApps 2.x\u3067\u524a\u9664\u3055\u308c\u305f\u3002<\/p>\n\n\n\n<p>\u4ee3\u308f\u308a\u306b\u3001<code>MetroWindow<\/code>\u306e\u5185\u5074\u306e<code>WindowButtonCommands<\/code>\u304c\u5bfe\u5fdc\u3059\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6301\u3063\u3066\u3044\u308b\u3002 Light\u30c6\u30fc\u30de\u306e\u5834\u5408\u306f\u3001\u305d\u308c\u305e\u308c<code>LightMinButtonStyle<\/code>\u3068<code>LightCloseButtonStyle<\/code>\u3067\u3042\u308b\u3002\u5225\u306e\u30b9\u30bf\u30a4\u30eb\u306e\u5185\u5074\u306e\u30b9\u30bf\u30a4\u30eb\u3092\u5b9a\u7fa9\u3059\u308b\u969b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>Style.Resources<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3002<\/p>\n\n\n\n<script type=\"text\/plain\" class=\"lang-xml\"><Style x:Key=\"WindowStyle\" TargetType=\"mah:MetroWindow\">\n...\n    <Style.Resources>\n        <Style TargetType=\"mah:WindowButtonCommands\" BasedOn=\"{StaticResource MahApps.Styles.WindowButtonCommands}\">\n            <Setter Property=\"LightCloseButtonStyle\" Value=\"{StaticResource WindowButtonStyle}\"\/>\n            <Setter Property=\"LightMinButtonStyle\" Value=\"{StaticResource WindowButtonStyle}\"\/>\n        <\/Style>\n    <\/Style.Resources>\n...\n<\/Style>\n<\/script>\n\n\n\n<p>\u4e0a\u306e<code>WindowButtonStyle<\/code>\u306f\u3001\u30dc\u30bf\u30f3\u306e\u5e45\u3092\u305b\u307e\u304f\u3059\u308b\u305f\u3081\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u3066\u3044\u305f\u3002\u3057\u304b\u3057\u3001<code>MetroBaseWindowButtonStyle<\/code>\u306fMahApps 2.x\u306b\u306f\u306a\u304f\u3001\u3053\u308c\u3092<code>MahApps.Styles.Button.MetroWindow.Light<\/code>\u3068\u7f6e\u304d\u63db\u3048\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002<\/p>\n\n\n\n<pre><code class=\"lang-xml\">&lt;Style x:Key=\"WindowButtonStyle\" TargetType=\"Button\" BasedOn=\"{StaticResource <mark>MetroBaseWindowButtonStyle<\/mark>}\"&gt;\n    &lt;Setter Property=\"Width\" Value=\"26\"\/&gt;\n&lt;\/Style&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30dc\u30bf\u30f3\u306e\u30e9\u30d9\u30eb<\/h3>\n\n\n\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b9\u30bf\u30a4\u30eb\u3067\u306f\u30dc\u30bf\u30f3\u306e\u30e9\u30d9\u30eb\u304c\u5927\u6587\u5b57\u5316\u3068\u592a\u5b57\u5316\u3055\u308c\u308b\u304c\u3001\u305d\u308c\u3092\u7121\u52b9\u5316\u3059\u308b\u4ee5\u4e0b\u306e<code>ButtonStyle<\/code>\u3067\u3082\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3002<code>MetroButton<\/code>\u30b9\u30bf\u30a4\u30eb\u3068<code>ButtonHelper<\/code>\u30af\u30e9\u30b9\u306f2.x\u306b\u306f\u5b58\u5728\u3057\u306a\u3044\u3002<\/p>\n\n\n\n<pre><code class=\"lang-xml\">&lt;Style x:Key=\"ButtonStyle\" TargetType=\"Button\" BasedOn=\"{StaticResource <mark>MetroButton<\/mark>}\"&gt;\n    &lt;Setter Property=\"mah:<mark>ButtonHelper<\/mark>.PreserveTextCase\" Value=\"True\"\/&gt;\n    &lt;Setter Property=\"FontWeight\" Value=\"Normal\"\/&gt;\n&lt;\/Style&gt;\n<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306f\u305d\u308c\u305e\u308c<code>MahApps.Styles.Button<\/code>\u3068<code>ControlsHelper<\/code>\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u305f\u3002\u305f\u3060\u3057<code>ControlsHelper<\/code>\u306f<code>PreserveTextCase<\/code>\u3067\u306f\u306a\u304f<code>ContentCharacterCasing<\/code>\u3092\u6301\u3064\u3002\u4e0a\u306e\u30a8\u30e9\u30fc\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u305f\u3002<\/p>\n\n\n\n<script type=\"text\/plain\" class=\"lang-xml\"><Style x:Key=\"ButtonStyle\" TargetType=\"Button\" BasedOn=\"{StaticResource MahApps.Styles.Button}\">\n    <Setter Property=\"mah:ControlsHelper.ContentCharacterCasing\" Value=\"Normal\"\/>\n    <Setter Property=\"FontWeight\" Value=\"Normal\"\/>\n<\/Style>\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b21\u306f<\/h2>\n\n\n\n<p>MahApps.Metro\u306e\u79fb\u884c\u4f5c\u696d\u306f\u3053\u308c\u3067\u7d42\u308f\u308a\u3067\u3042\u308b\u3002\u4eca\u5ea6\u306f<a rel=\"noreferrer noopener\" href=\"https:\/\/prismlibrary.com\/\" data-type=\"URL\" data-id=\"https:\/\/prismlibrary.com\/\" target=\"_blank\">Prism<\/a>\u30926.2\u304b\u30898.0\u306b\u79fb\u884c\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002MahApps.Metro 2.x\u306f8.0\u3088\u308a\u53e4\u3044Prism\u3068\u4e92\u63db\u6027\u304c\u306a\u3044\u30022.x\u304c\u4f9d\u5b58\u3059\u308bXamlBehaviors.WPF\u3068\u3001\u53e4\u3044Prism\u304c\u4f9d\u5b58\u3059\u308bWindows.Interactivity\u304c\u5171\u5b58\u3067\u304d\u306a\u3044\u304b\u3089\u3060\u3002\u3053\u306e\u79fb\u884c\u624b\u9806\u306f\u5225\u306e\u8a18\u4e8b\u3067\u7d39\u4ecb\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30c4\u30fc\u30ebBurageSnap\u306b\u304a\u3051\u308bMahApps.Metro 1.3.0\u304b\u30892.4.3\u3078\u306e\u79fb\u884c\u4f5c\u696d\u3092\u7d39\u4ecb\u3059\u308b\u3002BurageSnap\u3067\u306f\u4ee5\u4e0b\u306e\u5c0f\u3055\u306a\u30d5\u30c3\u30c8\u30d7\u30ea\u30f3\u30c8\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u3001MahA &hellip; <a href=\"https:\/\/roundwide.com\/ja\/migrate-to-mahapps-2-x\/\" class=\"more-link\"><span class=\"screen-reader-text\">\"MahApps.Metro 2.x\u3078\u306e\u79fb\u884c\u4f5c\u696d\" \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"https:\/\/roundwide.com\/?p=671","footnotes":""},"categories":[10,11],"tags":[],"class_list":["post-671","post","type-post","status-publish","format-standard","hentry","category-csharp","category-wpf","ja"],"_links":{"self":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts\/671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/comments?post=671"}],"version-history":[{"count":6,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts\/671\/revisions"}],"predecessor-version":[{"id":897,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/posts\/671\/revisions\/897"}],"wp:attachment":[{"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/media?parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/categories?post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roundwide.com\/wp-json\/wp\/v2\/tags?post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}