{"id":3230,"date":"2012-03-03T01:49:01","date_gmt":"2012-03-02T16:49:01","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/archives\/3230"},"modified":"2012-03-03T01:49:53","modified_gmt":"2012-03-02T16:49:53","slug":"visual-studio-%e3%81%ae-t4-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%80%81viewmodel-%e3%82%92%e8%87%aa%e5%8b%95%e7%94%9f%e6%88%90%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b%ef%bc%88%e5%a4%9a%e5%88%86%e9%80%94","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/3230","title":{"rendered":"Visual Studio \u306e T4 \u3092\u4f7f\u3063\u3066\u3001ViewModel \u3092\u81ea\u52d5\u751f\u6210\u3057\u3066\u307f\u308b\uff08\u591a\u5206\u9014\u4e2d\uff09"},"content":{"rendered":"<p>\n\u5e38\u3005\u3001C# \u3067\u306f C\/C++ \u306e\u3088\u3046\u306b\u30de\u30af\u30ed\u304c\u4f7f\u3048\u3093&#8230;\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f Visual Studio 2008\/2010 \u4e0a\u3067\u3042\u308c\u3070\u3001T4(TextTemplatingFilePreprocessor)\u3092\u4f7f\u3063\u3066\u30de\u30af\u30ed\u3063\u307d\u3044\u52d5\u304d\u304c\u3067\u304d\u308b\uff08\uff1d\u30b3\u30fc\u30c9\u306e\u81ea\u52d5\u751f\u6210\u304c\u3067\u304d\u308b\uff09\u3063\u3066\u3053\u3068\u3092\u4eca\u9803\u518d\u78ba\u8a8d\u3057\u3066\u3001\u3042\u3042\u3001\u306a\u308b\u307b\u3069\u3068\u601d\u3063\u3066\u4f5c\u3063\u3066\u307f\u305f\u6b21\u7b2c\u3067\u3059\u3002\n<\/p>\n<p>\n\u30b3\u30fc\u30c9\u751f\u6210\u3068 T4 \u30c6\u30ad\u30b9\u30c8 \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/bb126445.aspx\">http:\/\/msdn.microsoft.com\/ja-jp\/library\/bb126445.aspx<\/a><br \/>\nT4 Template\u3067ViewModel\u306e\u751f\u6210\u3092\u3059\u308b\u30a2\u30a4\u30c6\u30e0\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u308a\u307e\u3057\u305f &#8211; \u304b\u305a\u304d\u306eBlog@Hatena<br \/>\n<a href=\"http:\/\/d.hatena.ne.jp\/okazuki\/20110325\/1301070808\">http:\/\/d.hatena.ne.jp\/okazuki\/20110325\/1301070808<\/a><br \/>\n\u5ba3\u8a00\u7684\u306b\u30af\u30e9\u30b9\u3092\u5ba3\u8a00\u3057T4 Template\u3067\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b &#8211; \u304b\u305a\u304d\u306eBlog@Hatena<br \/>\n<a href=\"http:\/\/d.hatena.ne.jp\/okazuki\/20110408\/1302275410\">http:\/\/d.hatena.ne.jp\/okazuki\/20110408\/1302275410<\/a>\n<\/p>\n<p>\n\u3092\u53c2\u8003\u306b\u3057\u3066\u3001*.tt \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u3001ViewModel \u3092\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002ViewModel \u30af\u30e9\u30b9\u306f\u3001<a href=\"http:\/\/www.moonmile.net\/blog\/archives\/324\">Silverlight + MVVM \u30e2\u30c7\u30eb\u3067 DataGrid \u3092\u30d0\u30a4\u30f3\u30c9\u306e\u843d\u3068\u3057\u7a74\uff08\u305d\u306e\uff12\uff09 | Moonmile Solutions Blog<\/a> \u3067\u66f8\u3044\u3066\u3044\u305f\u3068\u304d\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002\u30c1\u30fc\u30d7\u3059\u304e\u3066\u5b9f\u7528\u7684\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001T4 \u306e\u81ea\u52d5\u751f\u6210\u306e\u78ba\u8a8d\u3068\u3057\u3066\u3002\n<\/p>\n<p>\n<a href=\"http:\/\/d.hatena.ne.jp\/okazuki\/20110408\/1302275410\">\u5ba3\u8a00\u7684\u306b\u30af\u30e9\u30b9\u3092\u5ba3\u8a00\u3057T4 Template\u3067\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3059\u308b &#8211; \u304b\u305a\u304d\u306eBlog@Hatena<\/a> \u306a\u3068\u3053\u308d\u3067\u306f\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3061\u3089\u3067\u306f\u3001\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/\/ &lt;summary&gt;\n\/\/\/ ViewModel \u30af\u30e9\u30b9\n\/\/\/ &lt;\/summary&gt;\n &#x5B;ViewModelTarget]\npublic class _ViewModel\n{\n\tpublic int id { get; set; }\n\tpublic string name { get; set; }\n\tpublic int age { get; set; }\n\tpublic DateTime UpdateAt { get; set; }\n}\n<\/pre>\n<p>\n\u306a\u98a8\u306b\u3001\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3057\u3066\u304a\u3051\u3070\u52dd\u624b\u306b INotifyPropertyChanged \u3092\u7d99\u627f\u3057\u305f ViewModel \u30af\u30e9\u30b9\u3092\u4f5c\u308b\u3001\u3063\u3066\u3068\u3053\u308d\u3092\u76ee\u6307\u3057\u3066\u307f\u307e\u3059\u3002\u8a2d\u5b9a\u81ea\u4f53\u304c\u751f\u306e\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3063\u3066\u3053\u3068\u308d\u304c\u30df\u30bd\u3067\u3059\u3002\n<\/p>\n<p>\n\u5b9f\u306f\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089\u81ea\u5206\u306e\u30a2\u30bb\u30f3\u30d6\u30ea\u3092\u53c2\u7167\u3059\u308b\u65b9\u6cd5\u304c\u4e0d\u660e\u306a\u306e\u3067\uff08\u3082\u3046\u5c11\u3057\u30c8\u30ea\u30c3\u30ad\u30fc\u306a\u3053\u3068\u3092\u3084\u308c\u3070\u3067\u304d\u305d\u3046\u306a\u3093\u3067\u3059\u304c\uff09\u3001ViewModel \u3092\u53c2\u7167\u3055\u305b\u308b\u305f\u3081\u3060\u3051\u306e\u30a2\u30bb\u30f3\u30d6\u30ea\u3092\u5225\u306b\u7528\u610f\u3057\u3066\u3044\u307e\u3059\u3002\n<\/p>\n<p><a href='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2012\/03\/wpid-dworkblogimage20120303_01org.jpg'><img border='0' src='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2012\/03\/wpid-dworkblogimage20120303_01thum.jpg'\/><\/a><\/p>\n<ul>\n<li>SampleT4 \u306b\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<li>SampleT4Target \u306f\u3001\u30a2\u30bb\u30f3\u30d6\u30ea\u3092\u53c2\u7167\u3059\u308b\u305f\u3081\u306b\u7528\u610f\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>SampleT4 \u304b\u3089 SampleT4Target \u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u53c2\u7167\u3057\u307e\u3059\u3002<\/li>\n<li>_ViewModel.cs \u306b\u306f\u3001\u5148\u306e\u5143\u306b\u306a\u308b\u30af\u30e9\u30b9\u304c\u306f\u3044\u3063\u3066\u3044\u3066\u30012\u3064\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5171\u6709\uff08\u30ea\u30f3\u30af\uff09\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\n\u25a0\u30bf\u30fc\u30b2\u30c3\u30c8\u3068\u306a\u308b ViewModel \u30af\u30e9\u30b9\n<\/p>\n<p>\n\u3061\u3087\u3063\u3068\u7121\u7406\u77e2\u7406\u3067\u3059\u304c\u3001\u89e3\u6790\u7528\u306e\u305f\u3081\u306e MakeViewModel \u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u5c5e\u6027\u300cViewModelTarget\u300d\u304c\u4ed8\u3044\u3066\u3044\u308b\u30af\u30e9\u30b9\u3092\u63a2\u3059\u306e\u3067\u3059\u304c\u3001_ViewModel.cs \u81ea\u4f53\u304c\u5171\u6709\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u7121\u7406\u77e2\u7406\u3001\u6587\u5b57\u5217\u3067\u5c5e\u6027\u5024\u3092\u8abf\u3079\u3066\u3044\u307e\u3059\u3002\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nnamespace SampleT4Target\n{\n\t\/\/\/ &lt;summary&gt;\n\t\/\/\/ ViewModel \u30af\u30e9\u30b9\n\t\/\/\/ &lt;\/summary&gt;\n\t&#x5B;ViewModelTarget]\n\tpublic class _ViewModel\n\t{\n\t\tpublic int id { get; set; }\n\t\tpublic string name { get; set; }\n\t\tpublic int age { get; set; }\n\t\tpublic DateTime UpdateAt { get; set; }\n\t}\n\n\tpublic class MakeViewModel\n\t{\n\t\tpublic string className;\n\t\tpublic List&lt;Prop&gt; props;\n\t\tpublic MakeViewModel( Type c )\n\t\t{\n\t\t\tthis.className = c.Name;\n\t\t\tthis.props = new List&lt;Prop&gt;();\n\t\t\tforeach (var p in c.GetProperties())\n\t\t\t{\n\t\t\t\tprops.Add(new Prop { name = p.Name, type = p.PropertyType });\n\t\t\t}\n\t\t}\n\t\tpublic class Prop\n\t\t{\n\t\t\tpublic string name { get; set; }\n\t\t\tpublic Type type { get; set; }\n\t\t}\n\t\tpublic static List&lt;Type&gt; TargetTypes(string fname = &amp;quot;&amp;quot;)\n\t\t{\n\t\t\tvar lst = new List&lt;Type&gt;();\n\n\t\t\tAssembly asm = (fname == &amp;quot;&amp;quot;)?\n\t\t\t\tAssembly.GetExecutingAssembly():\n\t\t\t\tAssembly.LoadFile(fname);\n\n\t\t\tforeach (var t in asm.GetTypes())\n\t\t\t{\n\t\t\t\tforeach (var at in t.GetCustomAttributes(false))\n\t\t\t\t{\n\t\t\t\t\tif ( at.GetType().ToString().IndexOf(&amp;quot;ViewModelTarget&amp;quot;) &gt;= 0 ) \n\t\t\t\t\t\/\/ var attr = at as ViewModelTargetAttribute;\n\t\t\t\t\t\/\/ if (attr != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tlst.Add(t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn lst;\n\t\t}\n\t}\n\tpublic class ViewModelTargetAttribute : Attribute\n\t{\n\t}\n}\n<\/pre>\n<p>\n\u25a0ViewModel \u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\n<\/p>\n<p>\n\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb\u300cViewModel.tt\u300d\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30a2\u30bb\u30f3\u30d6\u30ea\u3092\u76f4\u63a5\u53c2\u7167\u3055\u305b\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u3053\u304c\u5acc\u306a\u3093\u3067\u3059\u304c\uff08\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u304c\u5909\u308f\u308b\u3068\u5909\u66f4\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\uff09\u3072\u3068\u307e\u305a\u3001\u3053\u308c\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u901a\u308a\u307e\u3059\u3002\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&lt;#@ template debug=&amp;quot;false&amp;quot; hostspecific=&amp;quot;false&amp;quot; language=&amp;quot;C#&amp;quot; #&gt;\n&lt;#@ output extension=&amp;quot;.cs&amp;quot; #&gt;\n&lt;#@ assembly name=&amp;quot;$(SolutionDir)\\SampleT4Target\\bin\\Debug\\SampleT4Target.dll&amp;quot; #&gt;\n&lt;#@ import namespace=&amp;quot;SampleT4Target&amp;quot; #&gt;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.ComponentModel;\n\nnamespace SampleT4\n{\n&lt;#\nvar types = MakeViewModel.TargetTypes();\nforeach (var t in types) {\n\tvar mk = new MakeViewModel(t);\n#&gt;\n\t\/\/\/ &lt;summary&gt;\n\t\/\/\/ &lt;#= mk.className #&gt; \u30af\u30e9\u30b9\n\t\/\/\/ &lt;\/summary&gt;\n\tpublic class &lt;#= mk.className #&gt; : INotifyPropertyChanged\n\t{\n&lt;# foreach ( var p in mk.props ) { #&gt;\n\t\tprivate &lt;#= p.type.ToString() #&gt; _&lt;#= p.name #&gt;;\n\t\tpublic &lt;#= p.type.ToString() #&gt; &lt;#= p.name #&gt;\n\t\t{\n\t\t\tget { return _&lt;#= p.name #&gt;; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_&lt;#= p.name #&gt; != value)\n\t\t\t\t{\n\t\t\t\t\t_&lt;#= p.name #&gt; = value;\n\t\t\t\t\tOnPropertyChanged(&amp;quot;&lt;#= p.name #&gt;&amp;quot;);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n&lt;# } #&gt;\n\t\t#region INotifyPropertyChanged \u30e1\u30f3\u30d0\n\t\t\/\/\/ &lt;summary&gt;\n\t\t\/\/\/ \u30d7\u30ed\u30d1\u30c6\u30a3\u5909\u66f4\u6642\u306e\u30a4\u30d9\u30f3\u30c8\n\t\t\/\/\/ &lt;\/summary&gt;\n\t\tpublic event PropertyChangedEventHandler PropertyChanged;\n\t\tprotected virtual void OnPropertyChanged(PropertyChangedEventArgs e)\n\t\t{\n\t\t\tif (PropertyChanged != null)\n\t\t\t\tPropertyChanged(this, e);\n\t\t}\n\t\tprotected virtual void OnPropertyChanged(string name)\n\t\t{\n\t\t\tif (PropertyChanged != null)\n\t\t\t\tPropertyChanged(this, new PropertyChangedEventArgs(name));\n\t\t}\n\t\t#endregion\n\t}\n&lt;# } #&gt;\n}\n<\/pre>\n<p>\n\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u4e2d\u8eab\u81ea\u4f53\u306f\u3001\u30a4\u30f3\u30c6\u30ea\u30bb\u30f3\u30b9\u304c\u52b9\u304b\u306a\u3044\u72b6\u614b\u306a\u306e\u3067\uff08T4\u7528\u306e\u62e1\u5f35\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u5165\u308c\u308b\u3068\u52b9\u304d\u307e\u3059\uff09\u3001\u4e00\u5ea6 *.cs \u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3066\u304b\u3089\u3061\u307e\u3061\u307e\u3068\u79fb\u3057\u3066\u3044\u307e\u3059\u3002PHP \u304b ASP.NET \u98a8\u306b\u66f8\u3051\u3070 ok \u3067\u3059\u3002\n<\/p>\n<p><a href='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2012\/03\/wpid-dworkblogimage20120303_02org.jpg'><img border='0' src='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2012\/03\/wpid-dworkblogimage20120303_02thum.jpg'\/><\/a><\/p>\n<p>\nDevart T4 Editor for Visual Studio 2010 sample<br \/>\n<a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/a42a8538-8d6e-491b-8097-5a8a00174d37\">http:\/\/visualstudiogallery.msdn.microsoft.com\/a42a8538-8d6e-491b-8097-5a8a00174d37<\/a><br \/>\n\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u3067\u304d\u307e\u3059\u3002\n<\/p>\n<p>\n\u25a0\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f ViewModel.cs\n<\/p>\n<p>\n\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4fdd\u5b58\u3059\u308b\u3068\u3001T4(TextTemplatingFileGenerator)\u304c\u5b9f\u884c\u3055\u308c\u3066\u3001ViewModel.cs \u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\u672c\u6765\u306f\u3001partial \u306b\u3057\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u90e8\u5206\u3068\u5206\u96e2\u3055\u305b\u308b\u3068\u826f\u3044\u304b\u306a\u3068\u3002\u30af\u30e9\u30b9\u540d\u304c\u5143\u30cd\u30bf\u306e\u30af\u30e9\u30b9\u3068\u540c\u3058\u306a\u306e\u3067\u3001\u5b9f\u969b\u306f\u4f55\u3089\u304b\u306e\u30eb\u30fc\u30eb\u3067\u5909\u3048\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3057\u3087\u3046\u3002\n<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.ComponentModel;\n\nnamespace SampleT4\n{\n\t\/\/\/ &lt;summary&gt;\n\t\/\/\/ _ViewModel \u30af\u30e9\u30b9\n\t\/\/\/ &lt;\/summary&gt;\n\tpublic class _ViewModel : INotifyPropertyChanged\n\t{\n\t\tprivate System.Int32 _id;\n\t\tpublic System.Int32 id\n\t\t{\n\t\t\tget { return _id; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_id != value)\n\t\t\t\t{\n\t\t\t\t\t_id = value;\n\t\t\t\t\tOnPropertyChanged(&amp;quot;id&amp;quot;);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprivate System.String _name;\n\t\tpublic System.String name\n\t\t{\n\t\t\tget { return _name; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_name != value)\n\t\t\t\t{\n\t\t\t\t\t_name = value;\n\t\t\t\t\tOnPropertyChanged(&amp;quot;name&amp;quot;);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprivate System.Int32 _age;\n\t\tpublic System.Int32 age\n\t\t{\n\t\t\tget { return _age; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_age != value)\n\t\t\t\t{\n\t\t\t\t\t_age = value;\n\t\t\t\t\tOnPropertyChanged(&amp;quot;age&amp;quot;);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprivate System.DateTime _UpdateAt;\n\t\tpublic System.DateTime UpdateAt\n\t\t{\n\t\t\tget { return _UpdateAt; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_UpdateAt != value)\n\t\t\t\t{\n\t\t\t\t\t_UpdateAt = value;\n\t\t\t\t\tOnPropertyChanged(&amp;quot;UpdateAt&amp;quot;);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#region INotifyPropertyChanged \u30e1\u30f3\u30d0\n\t\t\/\/\/ &lt;summary&gt;\n\t\t\/\/\/ \u30d7\u30ed\u30d1\u30c6\u30a3\u5909\u66f4\u6642\u306e\u30a4\u30d9\u30f3\u30c8\n\t\t\/\/\/ &lt;\/summary&gt;\n\t\tpublic event PropertyChangedEventHandler PropertyChanged;\n\t\tprotected virtual void OnPropertyChanged(PropertyChangedEventArgs e)\n\t\t{\n\t\t\tif (PropertyChanged != null)\n\t\t\t\tPropertyChanged(this, e);\n\t\t}\n\t\tprotected virtual void OnPropertyChanged(string name)\n\t\t{\n\t\t\tif (PropertyChanged != null)\n\t\t\t\tPropertyChanged(this, new PropertyChangedEventArgs(name));\n\t\t}\n\t\t#endregion\n\t}\n}\n<\/pre>\n<p>\n\u3068\u3001\u3053\u3053\u307e\u3067\u751f\u6210\u304c\u3067\u304d\u307e\u3059\u3002\n<\/p>\n<p>\n\u672c\u5f53\u306f\u3001\u5225\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u306e\u3067\u306f\u306a\u304f\u3066\u81ea\u524d\u306e\u30a2\u30bb\u30f3\u30d6\u30ea\u3092\u53c2\u7167\u3057\u3066\u3001\u5bfe\u8c61\u306e ViewModel \u30af\u30e9\u30b9\u3092\u898b\u3064\u3051\u305f\u3044\u3067\u3059\u3088\u306d\u3002\u4e00\u5ea6\u3001\u300cViewModelTarget\u300d\u306e\u5c5e\u6027\u304c\u306a\u3044\u72b6\u614b\u3067\u30d3\u30eb\u30c9\u3092\u3057\u305f\u5f8c\u306b\u3001\u5225\u306e\u3068\u3053\u308d\u306b\u4fdd\u5b58\u3002\u305d\u308c\u3092\u4e00\u6642\u7684\u306b\u53c2\u7167\u3055\u305b\u308c\u3070\u3088\u3044\u304b\u306a\u3001\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u304c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e38\u3005\u3001C# \u3067\u306f C\/C++ \u306e\u3088\u3046\u306b\u30de\u30af\u30ed\u304c\u4f7f\u3048\u3093&#8230;\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f Visual Studio 2008\/2010 \u4e0a\u3067\u3042\u308c\u3070\u3001T4(TextTemplatingFilePreprocessor &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/3230\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[23],"tags":[],"class_list":["post-3230","post","type-post","status-publish","format-standard","hentry","category-csharp"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/3230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=3230"}],"version-history":[{"count":2,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/3230\/revisions"}],"predecessor-version":[{"id":3232,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/3230\/revisions\/3232"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=3230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=3230"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=3230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}