{"id":5131,"date":"2014-11-13T02:28:07","date_gmt":"2014-11-12T17:28:07","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5131"},"modified":"2014-11-14T02:37:31","modified_gmt":"2014-11-13T17:37:31","slug":"wpf-%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e5%9b%bd%e9%9a%9b%e5%8c%96-windows-netwpf","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5131","title":{"rendered":"WPF \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u56fd\u969b\u5316 (Windows\/.NET\/WPF)"},"content":{"rendered":"<p>.NET \u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u56fd\u969b\u5316\u3059\u308b\u305f\u3081\u306b\u6587\u5b57\u5217\u7b49\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5206\u96e2\u3059\u308b\u306b\u306f\u3001\u5927\u304d\u304f\u5206\u3051\u30663\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<a href=\"http:\/\/tocsworld.wordpress.com\/2014\/08\/13\/%E5%A4%9A%E8%A8%80%E8%AA%9E%E5%AF%BE%E5%BF%9Cc%E3%80%81wpf%E7%B7%A8\/\">\u53c2\u8003\u8a18\u4e8b<\/a><\/p>\n<p><!--more--><\/p>\n<h3>LocBAML \u3092\u4f7f\u3046<\/h3>\n<p><a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/ms746621%28v=vs.110%29.aspx\">\u3053\u3053\u306b\u66f8\u3044\u3066\u3042\u308b<\/a>\u3093\u3067\u3059\u304c\u2026\u306f\u3063\u304d\u308a\u8a00\u3063\u3066\u3081\u3093\u3069\u304f\u3055\u3044\u3067\u3059\u3002\u307e\u305a\u30c4\u30fc\u30eb\u3092\u81ea\u5206\u3067\u30d3\u30eb\u30c9\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u3068\u3044\u3046\u306e\u304c\u30a4\u30b1\u3066\u306a\u3044\u3002<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u305d\u308c\u4ee5\u4e0a\u306f\u8abf\u3079\u3066\u307e\u305b\u3093\u3002<\/p>\n<h3>Resources.resx \u3092\u4f7f\u3046<\/h3>\n<ul>\n<li>\u6614 (.NET 1.1) \u304b\u3089\u3042\u308b\u65b9\u6cd5<\/li>\n<li>Visual Studio \u306b\u306f GUI \u30a8\u30c7\u30a3\u30bf\u304c\u3042\u308b<\/li>\n<li>\u30b3\u30fc\u30c9\u304b\u3089\u30ea\u30bd\u30fc\u30b9\u306e\u4e2d\u8eab\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u9759\u7684\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6301\u3064\u30af\u30e9\u30b9\u3092\u81ea\u52d5\u751f\u6210\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<li>xaml \u304b\u3089\u53c2\u7167\u3059\u308b\u5834\u5408\u3001\u4e0a\u8a18\u30af\u30e9\u30b9\u306e\u30a2\u30af\u30bb\u30b9\u4fee\u98fe\u5b50\u3092 internal \u3067\u306f\u306a\u304f public \u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\uff08.NET Framework \u306e\u30a2\u30bb\u30f3\u30d6\u30ea\u304b\u3089\u53c2\u7167\u3057\u3088\u3046\u3068\u3059\u308b\u305f\u3081\uff09<\/li>\n<li>xaml \u304b\u3089\u53c2\u7167\u3059\u308b\u5834\u5408\u3001\u521d\u56de\u30d3\u30eb\u30c9\u6642\u306b\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002xaml \u306e\u65b9\u3092 touch \u3057\u3066\u307e\u305f\u30d3\u30eb\u30c9\u3059\u308b\u3068\u6210\u529f\u3059\u308b\uff08\u30d3\u30eb\u30c9\u9806\u5e8f\u306e\u95a2\u4fc2\uff1f\uff09<\/li>\n<li>Windows \u30d5\u30a9\u30fc\u30e0\u304b\u3089\u53c2\u7167\u3059\u308b\u3053\u3068\u304c\u6bd4\u8f03\u7684\u5bb9\u6613\uff08\u3089\u3057\u3044\uff09<\/li>\n<li>\u3053\u306e\u65b9\u6cd5\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u4ee5\u5916\u306e\u30ab\u30eb\u30c1\u30e3\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u308b\u3068\u3001\u30b5\u30c6\u30e9\u30a4\u30c8\u30a2\u30bb\u30f3\u30d6\u30ea\u304c\u751f\u6210\u3055\u308c\u308b<\/li>\n<\/ul>\n<h3>\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u3092\u4f7f\u3046<\/h3>\n<ul>\n<li>\u6bd4\u8f03\u7684\u65b0\u3057\u3044 (Silverlight \/ .NET 2.0) \u65b9\u6cd5<\/li>\n<li>GUI \u30a8\u30c7\u30a3\u30bf\u306f\u7121\u3044<\/li>\n<li>\u30b3\u30fc\u30c9\u304b\u3089\u30ea\u30bd\u30fc\u30b9\u306e\u4e2d\u8eab\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u81ea\u524d\u3067\u66f8\u304b\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\uff08\u5927\u3057\u305f\u30b3\u30fc\u30c9\u3067\u306f\u306a\u3044\uff09<\/li>\n<li>WPF \u3068\u306e\u89aa\u548c\u6027\u304c\u9ad8\u3044\u3002\u307e\u305f\u3001WPF \u306e\u300c\u30b9\u30bf\u30a4\u30eb\u300d\u3084\u300c\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u300d\u3068\u3044\u3063\u305f\u3082\u306e\u3092\u30ea\u30bd\u30fc\u30b9\u3068\u3057\u3066\u5206\u96e2\u3059\u308b\u5834\u5408\u306f\u3001\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308b<\/li>\n<li>Windows \u30d5\u30a9\u30fc\u30e0\u304b\u3089\u53c2\u7167\u3059\u308b\u306e\u306b\u306f\u5411\u3044\u3066\u3044\u306a\u3044\uff08\u3089\u3057\u3044\uff09<\/li>\n<li>\u30b5\u30c6\u30e9\u30a4\u30c8\u30a2\u30bb\u30f3\u30d6\u30ea\u306f\u751f\u6210\u3055\u308c\u306a\u3044<\/li>\n<li>\u5b9f\u306f\u3001\u30ab\u30eb\u30c1\u30e3\u306b\u3088\u3063\u3066\u9069\u5207\u306a\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u3092\u9078\u629e\u3059\u308b\u4ed5\u7d44\u307f\u306f\u5b58\u5728\u3057\u306a\u3044\uff08\u3089\u3057\u3044\uff09\u306e\u3067\u3001\u81ea\u524d\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308b\uff08\u5927\u3057\u305f\u30b3\u30fc\u30c9\u3067\u306f\u306a\u3044\uff09<\/li>\n<\/ul>\n<p>WPF \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5834\u5408\u306f Resources.resx \u3068\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u3068\u3067\u4e00\u9577\u4e00\u77ed\u3068\u3044\u3046\u6240\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<h3>\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u3092\u4f7f\u3046\u5834\u5408\u306e\u5177\u4f53\u4f8b<\/h3>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30ab\u30eb\u30c1\u30e3\u3092\u82f1\u8a9e\u3068\u3057\u3001\u65e5\u672c\u8a9e\u30ab\u30eb\u30c1\u30e3\u306e\u5834\u5408\u306f\u65e5\u672c\u8a9e\u30ea\u30bd\u30fc\u30b9\u304c\u4f7f\u308f\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u82f1\u8a9e\u3068\u65e5\u672c\u8a9e\u306e\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<p>Dictionary.xaml<\/p>\n<blockquote>\n<pre>&lt;ResourceDictionary xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\r\n                    xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\r\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\r\n    &lt;system:String x:Key=\"HogeFuga\"><strong>HogeFuga<\/strong>&lt;\/system:String>\r\n&lt;\/ResourceDictionary><\/pre>\n<\/blockquote>\n<p>Dictionary.ja.xaml<\/p>\n<blockquote>\n<pre>&lt;ResourceDictionary xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\r\n                    xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\r\n                    xmlns:system=\"clr-namespace:System;assembly=mscorlib\">\r\n    &lt;system:String x:Key=\"HogeFuga\"><strong>\u307b\u3052\u3075\u304c<\/strong>&lt;\/system:String>\r\n&lt;\/ResourceDictionary><\/pre>\n<\/blockquote>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30ea\u30bd\u30fc\u30b9\u304b\u3089\u53c2\u7167\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>App.xaml<\/p>\n<blockquote>\n<pre>&lt;Application x:Class=\"ResourceDictionarySample.App\"\r\n             xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\r\n             xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\r\n             StartupUri=\"MainWindow.xaml\">\r\n    &lt;Application.Resources>\r\n<strong>        &lt;ResourceDictionary>\r\n            &lt;ResourceDictionary.MergedDictionaries>\r\n                &lt;ResourceDictionary Source=\"Dictionary.xaml\" \/>\r\n            &lt;\/ResourceDictionary.MergedDictionaries>\r\n        &lt;\/ResourceDictionary><\/strong>\r\n    &lt;\/Application.Resources>\r\n&lt;\/Application><\/pre>\n<\/blockquote>\n<p>\u524d\u8ff0\u306e\u3068\u304a\u308a\u3001\u30ab\u30eb\u30c1\u30e3\u306b\u3088\u3063\u3066\u9078\u629e\u3059\u308b\u4ed5\u7d44\u307f\u306f\u81ea\u524d\u3067\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30ab\u30eb\u30c1\u30e3\u306f InitializeComponent() \u3067\u8aad\u307f\u8fbc\u307f\u3001\u8ffd\u52a0\u306e\u30ab\u30eb\u30c1\u30e3\u306f\u81ea\u524d\u30b3\u30fc\u30c9\u3067\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002MergedDictionaries \u306e\u4ed5\u7d44\u307f\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u65e5\u672c\u8a9e\u306e\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u306b\u3042\u308b\u30ea\u30bd\u30fc\u30b9\u306f\u305d\u308c\u304c\u4f7f\u308f\u308c\u3001\u306a\u3044\u30ea\u30bd\u30fc\u30b9\u306f\u82f1\u8a9e\u306e\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u304b\u3089\u691c\u7d22\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30ea\u30bd\u30fc\u30b9\u3092\u90e8\u5206\u7684or\u6bb5\u968e\u7684\u306b\u5730\u57df\u5316\u3059\u308b\u306e\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>App.xaml.cs<\/p>\n<blockquote>\n<pre>    public partial class App : Application\r\n    {\r\n        public App()\r\n        {\r\n            InitializeComponent();\r\n\r\n<strong>            string uiCulture = Thread.CurrentThread.CurrentUICulture.ToString();\r\n\r\n            if (uiCulture.StartsWith(\"ja\"))\r\n            {\r\n                ResourceDictionary dic = new ResourceDictionary();\r\n                dic.Source = new Uri(\"Dictionary.ja.xaml\", UriKind.Relative);\r\n                this.Resources.MergedDictionaries.Add(dic);\r\n            }<\/strong>\r\n        }\r\n    }<\/pre>\n<\/blockquote>\n<p>\u5b9f\u969b\u306b UI \u306e xaml \u304b\u3089\u53c2\u7167\u3057\u307e\u3059\u3002<\/p>\n<p>MainWindow.xaml<\/p>\n<blockquote>\n<pre>&lt;Window x:Class=\"ResourceDictionarySample.MainWindow\"\r\n        xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\r\n        xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\r\n        Title=\"MainWindow\">\r\n    &lt;StackPanel>\r\n        &lt;Button Content=\"<strong>{StaticResource HogeFuga}<\/strong>\"\/>\r\n    &lt;\/StackPanel>\r\n&lt;\/Window><\/pre>\n<\/blockquote>\n<p>\u30b3\u30fc\u30c9\u304b\u3089\u53c2\u7167\u3059\u308b\u5834\u5408\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>MainWindow.xaml.cs<\/p>\n<blockquote>\n<pre>    public partial class MainWindow : Window\r\n    {\r\n        public MainWindow()\r\n        {\r\n            InitializeComponent();\r\n\r\n            MessageBox.Show(<strong>(String)Application.Current.FindResource(\"HogeFuga\")<\/strong>);\r\n        }\r\n    }\r\n<\/pre>\n<\/blockquote>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30ab\u30eb\u30c1\u30e3\u306e\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306f App.xaml \u306b\u66f8\u304d\u3001\u305d\u308c\u4ee5\u5916\u306e\u30ab\u30eb\u30c1\u30e3\u306e\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u306f App.xaml.cs \u306b\u66f8\u3044\u3066\u3044\u307e\u3059\u3002\u30ea\u30bd\u30fc\u30b9\u30c7\u30a3\u30af\u30b7\u30e7\u30ca\u30ea\u306e\u6307\u5b9a\u3092\u5168\u90e8 App.xaml.cs \u306e\u65b9\u306b\u66f8\u3044\u3066\u3082\u540c\u3058\u5b9f\u884c\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001App.xaml \u306b\u66f8\u3044\u3066\u304a\u304f\u3068 MainWindow.xaml \u306e\u30c7\u30b6\u30a4\u30f3\u30d3\u30e5\u30fc\u3067\u3082\u30ea\u30bd\u30fc\u30b9\u3092\u53d6\u5f97\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u305f\u3081\u3001\u305d\u3061\u3089\u306e\u65b9\u304c\u4fbf\u5229\u306a\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002App.xaml \u3068 App.xaml.cs \u3068\u3067\u8a18\u8ff0\u5834\u6240\u304c\u5206\u6563\u3057\u3066\u3057\u307e\u3046\u306e\u304c\u30a4\u30b1\u3066\u307e\u305b\u3093\u304c\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.NET \u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u56fd\u969b\u5316\u3059\u308b\u305f\u3081\u306b\u6587\u5b57\u5217\u7b49\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5206\u96e2\u3059\u308b\u306b\u306f\u3001\u5927\u304d\u304f\u5206\u3051\u30663\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u53c2\u8003\u8a18\u4e8b<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-5131","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5131"}],"version-history":[{"count":19,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5131\/revisions"}],"predecessor-version":[{"id":5151,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5131\/revisions\/5151"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}