{"id":6045,"date":"2014-07-22T11:25:38","date_gmt":"2014-07-21T17:25:38","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=6045"},"modified":"2014-07-22T11:48:01","modified_gmt":"2014-07-22T02:48:01","slug":"xamarin-forms-%e3%81%ae-xaml-%e3%82%92-f-%e3%81%8b%e3%82%89%e4%bd%bf%e3%81%86%e3%81%9f%e3%82%81%e3%81%ab-xamltypeprovider-%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/6045","title":{"rendered":"Xamarin.Forms \u306e XAML \u3092 F# \u304b\u3089\u4f7f\u3046\u305f\u3081\u306b XamlTypeProvider \u3092\u4f7f\u3046"},"content":{"rendered":"<p>XFormsPreviewer \u3067\u306f\u3001\u52d5\u7684\u306bXAML\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\uff08\u5185\u90e8\u7684\u306b\u306fXamarin.Forms\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u751f\u6210\u3059\u308b\uff09\u3057\u3066\u30d7\u30ec\u30d3\u30e5\u30fc\u3092\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u30b3\u30a2\u30e9\u30a4\u30d6\u30e9\u30ea\u306b XamlTypeProvider \u304c\u3042\u308a\u307e\u3059\u3002\u6700\u521d\u306f Xamarin.Forms \u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u3060\u3051\u3092\u4f5c\u308b\u3064\u3082\u308a\u3060\u3063\u305f\u3051\u3069\u3001\u4f5c\u3063\u3066\u3044\u308b\u3046\u3061\u306b F# \u306e TypeProvider \u3068\u4f3c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u3001\u3058\u3083\u3042 TypeProvider \u7684\u306b\u3057\u3088\u3046\u3068\u3057\u305f\u306e\u304c\u767a\u7aef\u3067\u3059\u3002<\/p>\n<h2>\u25a0Xamrin.Forms \u3068 XAML \u306e\u95a2\u4fc2<\/h2>\n<p>\u8981\u306f\u3001WPF \u3084 Windows Store \u306e XAML \u3068\u540c\u3058\u3088\u3046\u306b\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3092\u8a18\u8ff0\u3059\u308b XAML \u3068\u3001\u30d3\u30eb\u30c9\u6642\u306b\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b partial class \u3068\u3067\u6210\u308a\u7acb\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e partial class \u306e\u307b\u3046\u3067\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u540d\u524d\u306b\u3088\u308b\u53c2\u7167\u3084\u3001\u30dc\u30bf\u30f3\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u306a\u3069\u3092\u8a18\u8ff0\u3059\u308b\u308f\u3051\u3067\u3001\u4e8b\u5b9f\u4e0a\u306e\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3067\u3059\u306d\u3002Silverlight \u306e XAML \u306e\u5834\u5408\u306b\u306f\u3001XAML \u81ea\u4f53\u306b C# \u306e\u30b3\u30fc\u30c9\u3092\u57cb\u3081\u8fbc\u3081\u308b\u306e\u3067\uff08\u4eca\u3067\u3082\u305d\u3046\u3060\u3068\u601d\u3046\uff09XAML \u5358\u4f53\u3067\u52d5\u304b\u3059\u3053\u3068\u3082\u53ef\u80fd\u306a\u308f\u3051\u3067\u3059\u304c&#8230;Windows Store\/Windows Phone 8.1 \u306e XAML \u306f\u3067\u304d\u305f\u304b\u3069\u3046\u304b\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u305f\u3076\u3093\u3001Xamarin.Forms \u306e XAML \u3082\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u3067\u3001\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3092\u4f7f\u3046\u3068\u3001XAML \u3067\u8a18\u8ff0\u3057\u305f View \u306b\u5185\u90e8\u52d5\u4f5c\u306e\u30b3\u30fc\u30c9\u304c\u57cb\u3081\u8fbc\u307e\u308c\u308b\u308f\u3051\u3067\u3001\uff08\u305d\u308c\u304c\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3060\u3068\u3057\u3066\u3082\uff09View \u3068 Logic \u304c\u5206\u96e2\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3002\u3068\u3044\u3046\u8a71\u306a\u306e\u3067\u3059\u304c\u3001\u307e\u3042\u3001\u5b9f\u88c5\u7684\u306b\u306f MVVM \u306e INotifyPropertyChanged\/ICommand \u306b\u3057\u3066\u3057\u307e\u3046\u304b\u3001\u5225\u306a\u65b9\u6cd5\u3092\u306b\u3057\u3066\u3057\u307e\u3046\u304b\u3001\u3068\u3044\u3046\u5177\u5408\u3067\u3059\u3002\u30ef\u30bf\u30af\u30b7\u7684\u306b\u306f\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3067\u3082\u3044\u3044\u3068\u601d\u3046\u3093\u3067\u3059\u3051\u3069\u306d\u3002\u3046\u307e\u304f\u5206\u96e2\u3055\u308c\u3066\u3044\u308c\u3070\u3002<\/p>\n<p>\u300c\u3046\u307e\u304f\u5206\u96e2\u3059\u308b\u300d\u3068\u3044\u3046\u70b9\u3067\u3001MVVM \u30d1\u30bf\u30fc\u30f3\u306f\u3001View \u3068 Model\u304c\u5206\u96e2\u3067\u304d\u3066\u3044\u307e\u3059\u304c\u3001\u8907\u6570\u306e View \u3092\u6271\u3046\u3068\u304d\u306b\u3061\u3087\u3063\u3068\u56f0\u308a\u307e\u3059\u3002\u3053\u308c\u306f Xamarin.Forms \u306e\u554f\u984c\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069\u3001\u3068\u3042\u308b\u30d3\u30e5\u30fc\u304b\u3089\u5225\u306e\u30d3\u30e5\u30fc\u306b\u79fb\u308b\u3068\u304d\u306b\u3001PushAsync \u3092\u4f7f\u3044\u307e\u3059\u304c\u3001\u3053\u306e Navigation \u30d7\u30ed\u30d1\u30c6\u30a3\u306f Page \u306b\u304f\u3063\u3064\u3044\u3066\u5f15\u6570\u3082\u30da\u30fc\u30b8\u306a\u3093\u3067\u3059\u3088\u306d\u3002<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\npage.Navigation.PushAsync(nextPage)\r\n<\/pre>\n<p>\u5f53\u305f\u308a\u524d\u3068\u3044\u3048\u3070\u5f53\u305f\u308a\u524d\u3060\u3051\u3069\u3001\u753b\u9762\u9077\u79fb\u81ea\u4f53\u306f\u3001\u30da\u30fc\u30b8\u304b\u3089\u30da\u30fc\u30b8\u306b\u79fb\u308b\u3002ViewModel \u306e\u5834\u5408\u306f Page \u306b\u4f9d\u5b58\u3057\u305f\u304f\u306a\u3044\u306e\u3067\u3001View \u304b\u3089\u672c\u683c\u7684\u306b ViewModel \u3092\u5206\u96e2\u3055\u305b\u305f\u3068\u304d\u306b Command \u30d1\u30bf\u30fc\u30f3\u5185\u3067\u306f\u4ed6\u306e\u30da\u30fc\u30b8\u306b\u9077\u79fb\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3001\u3063\u3066\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u3042\u3001\u73fe\u5b9f\u7684\u306a\u89e3\u3068\u3057\u3066\u306f ViewModel \u306b\u5bfe\u5fdc\u3059\u308b View \u3092\u6301\u305f\u305b\u3066\u3057\u307e\u3048\u3070\u3044\u3044\u306e\u3067\u3059\u304c\u3002<\/p>\n<p>\u305d\u3093\u306a\u4f9d\u5b58\u95a2\u4fc2\u304b\u3089\u3001Xamarin.Forms \u3082 Windows Store \u306e XAML \u3082 View=XAML \u306b\u5bfe\u5fdc\u3059\u308b\u30b3\u30fc\u30c9\u3092\u51fa\u529b\u3057\u3066\u3001\u5404\u7a2e\u30a4\u30d9\u30f3\u30c8\u3084\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3059\u308b\u65b9\u6cd5\u3092\u3068\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u5b9f\u306f\u3001F# \u306e TypeProvider \u3082\u540c\u3058\u3053\u3068\u304c\u8a00\u3048\u3066\u3001\u5b9f\u884c\u6642\u306b\u30d3\u30eb\u30c9\u3057\u3066 Type \u3092\u6c7a\u3081\u308b\u306e\u3067 FsXaml \u306e\u3088\u3046\u306b WPF \u306e XAML \u3092\u30b3\u30f3\u30d0\u30fc\u30c8\u3067\u304d\u308b\u3051\u3069\u3001\u3053\u308c\u306f\u52d5\u4f5c\u6642\u306b\u306f\u3067\u304d\u306a\u3044\u306e\u3067\u3059\u3002\u3068\u3044\u3046\u306e\u3082\u3001\u672a\u77e5\u306e XAML \u306b\u5bfe\u3057\u3066\u3001\u5185\u90e8\u30d7\u30ed\u30d1\u30c6\u30a3\u3084\u30a4\u30d9\u30f3\u30c8\u306e\u5224\u5b9a\u3092\u3001\u5148\u306b\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3088\u306d\u3002\u3002\u307e\u3042\u3001\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001<\/p>\n<ul>\n<li>XAML \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u6642\u306b TypeProvider \u3067\u30d3\u30eb\u30c9\u3059\u308b\u3002<\/li>\n<li>Page \u306b\u4ed8\u5c5e\u3059\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u3001dynamic \u3067\u53d7\u3051\u3066\u53c2\u7167\u3055\u305b\u308b\u3002<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u5b9f\u884c\u306b\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u306e\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308c\u3070\u3088\u3044\u306e\u3067\u3059\u304c\u3001\u5b8c\u5168\u306b\u30c0\u30a4\u30ca\u30df\u30c3\u30af\u306b\u3001\u3068\u3044\u3046\u308f\u3051\u306b\u306f\u3044\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u307e\u305f\u3001Xamrin.Forms \u306e XAML \u304b\u3089\u51fa\u529b\u3059\u308b\u30b3\u30fc\u30c9\u306f C# \u306e\u305f\u3081\u306b\u3001F# \u304b\u3089\u4f7f\u304a\u3046\u3068\u3059\u308b\u30d3\u30eb\u30c9\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f Windows Store \u306e XAML \u306e\u5834\u5408\u3082\u540c\u3058\u3067\u3001\u3053\u3053\u306e\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u306e\u30b3\u30fc\u30c9\u304c\u8a00\u8a9e\u4f9d\u5b58\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u90aa\u9b54\u3067\u3059\u3002XAML \u81ea\u4f53\u306f\u30b3\u30fc\u30c9\u4f9d\u5b58\u3057\u3066\u3044\u306a\u3044\u306e\u306b\u3002<br \/>\n\u9006\u306b\u8a00\u3048\u3070\u3001\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u306b\u5168\u304f\u4f9d\u5b58\u3057\u306a\u3044\u5f62\u3067\u3001\u66f8\u3051\u3070\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u304c C# \u3067\u3042\u308d\u3046\u3068 F# \u3067\u3042\u308d\u3046\u3068\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f Visual Basic \u3067\u3042\u308d\u3046\u3068\u95a2\u4fc2\u306a\u304f\u66f8\u3051\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>\u25a0View \u3068 ViewModel \u3092\u52d5\u7684\u306b\u306b\u30ea\u30f3\u30af\u3055\u305b\u308b<\/h2>\n<p>\u901a\u5e38\u306e MVVM \u30e2\u30c7\u30eb\u306e\u5834\u5408\u306b\u306f\u3001\u5148\u306e\u753b\u9762\u9077\u79fb\u306e\u95a2\u4fc2\u3082\u3042\u3063\u3066\u3001View \u3068 ViewModel \u306f1\u5bfe1\u306e\u95a2\u4fc2\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002View(XAML)\u306b\u5bfe\u3057\u3066\u3001\u3072\u3068\u3064\u3072\u3068\u3064 ViewModel \u3092\u4f5c\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001ViewModel \u304b\u3089 View \u3078\u306e\u4f9d\u5b58\u3092\u5b8c\u5168\u306b\u5207\u308a\u96e2\u3057\u3066\u3057\u307e\u3048\u3070\u3001\u3072\u3068\u3064\u306e ViewModel \u3092\u8907\u6570\u306e View \u306b\u5bfe\u5fdc\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u308c\u3092\u5b9f\u73fe\u3059\u308b\u306e\u306f\u975e\u5e38\u306b\u7c21\u5358\u3067\u3001\u540c\u3058 ViewModel \u3092\u4f7f\u3063\u3066\u3044\u308b\u3051\u3069\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u8907\u6570\u306e View \u3092\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u300c\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u300d\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u306e\u306f\u3001ViewModel \u306e\u4e2d\u3067\u306f\u306a\u304f\u3001\u5148\u306e Page \u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u306e\u4e2d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3001View \u3068 ViewModel \u3092\u5b8c\u5168\u306b\u5206\u96e2\u3055\u305b\u3088\u3046\u3068\u3059\u308b\u3068\u77db\u76fe\u304c\u3067\u307e\u3059\u3002<\/p>\n<p>&#8211; XAML \u306f\u3001\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3092\u51fa\u529b\u3059\u308b<br \/>\n&#8211; \u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3067\u306e\u307f\u3001\u753b\u9762\u9077\u79fb\/View\u306e\u5207\u308a\u66ff\u3048\u304c\u53ef\u80fd<br \/>\n&#8211; View \u306f ViewModel \u3068\u5206\u96e2\u3055\u305b\u305f\u3044<br \/>\n&#8211; ViewModel \u304b\u3089\u753b\u9762\u9077\u79fb\u304f\u3092\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u3002<\/p>\n<p>\u3053\u306e\u77db\u76fe\u306f\u3001XAML \u306e\u4ed5\u7d44\u307f\u304c\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\uff08partial class\uff09\u305f\u3081\u3067\u3042\u3063\u3066\u3001XAML \u81ea\u4f53\u304c\u5fb9\u5e95\u3057\u3066 View \u306b\u5fb9\u3057\u3066\u3044\u308c\u3070\u3001\u3046\u307e\u304f\u77db\u76fe\u304c\u89e3\u6d88\u3067\u304d\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002\u3082\u3061\u308d\u3093\u3001\u30d3\u30d8\u30a4\u30d3\u30a2\u306e\u3088\u3046\u306a View \u5185\u90e8\u306b\u5b58\u5728\u3059\u308b\u30b3\u30fc\u30c9\uff08\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\uff09\u306f\u3001XAML \u306b\u3042\u308b\u307b\u3046\u304c\u3088\u3044\u306e\u3067\u3059\u304c\u3001ViewModel \u3067\u3082\u307e\u304b\u306a\u3048\u308b\u3082\u306e\u306f\u3001\u5207\u308a\u96e2\u3057\u3066\u3057\u307e\u3063\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>&#8230;\u3068\u3044\u3046\u767a\u60f3\u306e\u3082\u3068\u306b\u3001XAML \u30b3\u30fc\u30c9\u81ea\u4f53\u3092\u5b8c\u5168\u306b\u52d5\u7684\u306b\u30ed\u30fc\u30c9\u3055\u305b\u307e\u3059\u3002\u52d5\u7684\u306b\u30ed\u30fc\u30c9\u3055\u305b\u308b\u308f\u3051\u3067\u3059\u304b\u3089\u3001\u672a\u77e5\u306e XAML \u30d5\u30a1\u30a4\u30eb\u3067\u3082\u5927\u4e08\u592b\u3067\u3059\u3002\u3044\u307e\u307e\u3067\u3001\u30ea\u30bd\u30fc\u30b9\u3068\u3057\u3066\u6301\u3064\u304b\u3001\u6587\u5b57\u5217\u3068\u3057\u3066\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306b\u57cb\u3081\u8fbc\u3080\u304b\u3057\u304b\u306a\u304b\u3063\u305f\u3082\u306e\u304c\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306b XAML \u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u3044\u3066\u3001\u305d\u308c\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u3042\u3001\u4f5c\u308a\u59cb\u3081\u3066\u5206\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3061\u3087\u3046\u3069 HTML \u304c\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u52d5\u304f\u306e\u3068\u540c\u3058\u4ed5\u7d44\u307f\u3067\u3059\u306d\u3002<\/p>\n<p>HTML \u306e\u5834\u5408\u304c<\/p>\n<ul>\n<li>HTML \u3067\u30c7\u30b6\u30a4\u30f3\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3002<\/li>\n<li>Javascript \u3067\u52d5\u304d\u306e\u3042\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3002<\/li>\n<li>Javascript \u306f\u30d6\u30e9\u30a6\u30b6\u306e\u30a4\u30f3\u30bf\u30fc\u30d7\u30ea\u30bf\u3067\u52d5\u304f<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u30b3\u30fc\u30c9\u90e8\u5206\u304c\u30a4\u30f3\u30bf\u30fc\u30d7\u30ea\u30bf\u306b\u3057\u304b\u306a\u3089\u306a\u3044\u306e\u304c\u30b9\u30d4\u30fc\u30c9\u3067\u306f\u30cd\u30c3\u30af\u3060\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>Xamarin.Forms \u7528\u306e XAML \u30d5\u30a1\u30a4\u30eb\u3092\u76f4\u63a5\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3001<\/p>\n<ul>\n<li>XAML \u3067\u30c7\u30b6\u30a4\u30f3\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3002<\/li>\n<li>\u52d5\u4f5c\u306f\u3001C# \u3067 ViewModel \u5185\u306b\u66f8\u304f\u3002\u3042\u308b\u3044\u306f\u3001\u52d5\u7684\u30ea\u30f3\u30af\u3055\u308c\u308b\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3082\u3069\u304d\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/li>\n<li>ViewModel\u5185 \u306e\u30b3\u30fc\u30c9\u306f\u4e8b\u524d\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u3001Xamarin \u306b\u3088\u308a\u30cd\u30a4\u30c6\u30a3\u30d6\u30b3\u30fc\u30c9\u3067\u52d5\u304f\u3002<\/li>\n<\/ul>\n<p>ViewModel \u306e\u30a2\u30bb\u30f3\u30d6\u30ea\u3092\u52d5\u7684\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u306f\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\uff08ActiveX\u307f\u305f\u3044\u306a\u611f\u3058\uff1f\uff09\u3001\u3072\u3068\u307e\u305a\u3001\u3053\u306e\u65b9\u5f0f\u3092\u3068\u308b\u3053\u3068\u3067 Javascript \u306a\u3069\u306b\u3088\u308b\u30a4\u30f3\u30bf\u30fc\u30d7\u30ea\u30bf\u3067\u306f\u306a\u3044\u30cd\u30a4\u30c6\u30a3\u30d6\u306e\u52d5\u4f5c\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\uff08\u3082\u3061\u308d\u3093\u3001Javascript\u7b49\u3067\u3042\u3063\u3066\u3082\u3001\u5b9f\u884c\u6642\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u308c\u3070\u30b9\u30d4\u30fc\u30c9\u306f\u540c\u3058\u306a\u3093\u3067\u3059\u3051\u3069\uff09\u3002<\/p>\n<p>Xaml \u306e\u30d1\u30fc\u30b9\u81ea\u4f53\u304c\u8eca\u8f2a\u306e\u518d\u767a\u660e\u3063\u307d\u3044\u306e\u3067\u3001\u3042\u307e\u308a\u3084\u308a\u305f\u304f\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u3056\u3063\u3068 F# \u3067\u66f8\u3044\u3066\u307f\u305f\u3068\u3053\u308d 400 \u884c\u7a0b\u5ea6\u306a\u306e\u3067\u306a\u3093\u3068\u304b\u8a31\u5bb9\u7bc4\u56f2\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2>\u25a0\u5b9f\u969b\u3069\u3046\u4f7f\u3046\u306e\u304b\uff1f<\/h2>\n<p>moonmile\/XamarinXamlPreview<br \/>\n<a href=\"https:\/\/github.com\/moonmile\/XamarinXamlPreview\">https:\/\/github.com\/moonmile\/XamarinXamlPreview<\/a><\/p>\n<p>Xamarin.Forms for F# \u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u7528\u306b\u4f5c\u3063\u305f\u306e\u3067 F# \u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u5f53\u7136\u306a\u304c\u3089 C# \u3067\u3082\u4f7f\u3048\u307e\u3059\u3002page.Navigation.PushAsync \u3042\u305f\u308a\u304c\u3001\u5909\u306a\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u306f F# \u3060\u304b\u3089\u3067\u3042\u3063\u3066\u3001C# \u3060\u3068\u7d50\u69cb\u7d20\u76f4\u306b\u66f8\u3051\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\ntype MainPage(path:string) =\r\n    inherit ContentPage()\r\n    let mutable page:Page = null\r\n    let mutable buttonNextPage:Button = null\r\n    let mutable buttonStopWatch:Button = null\r\n    let mutable buttonStopWatchDownload:Button = null\r\n    let mutable label:Label = null\r\n    \r\n    let pushPageVM(rn:string, vm:ViewModelBase) =\r\n        let xaml = ResourceLoader.GetString(rn)\r\n        let next = ParseXaml.LoadXaml(xaml) \r\n        next.BindingContext &lt;- vm\r\n        let t = new Task( fun() -&gt; \r\n            let task = page.Navigation.PushAsync(next)\r\n            task.Start()\r\n        )\r\n        t.RunSynchronously()\r\n    \r\n    let pushPage(rn:string) =\r\n        let xaml = ResourceLoader.GetString(rn)\r\n        let next = ParseXaml.LoadXaml(xaml) \r\n        let t = new Task( fun() -&gt; \r\n            let task = page.Navigation.PushAsync(next)\r\n            task.Start()\r\n        )\r\n        t.RunSynchronously()\r\n\r\n    let pushPageDL(url:string) =\r\n        \r\n        try \r\n            let hc = new HttpClient()\r\n            let xaml = hc.GetStringAsync(url).Result\r\n            let next = ParseXaml.LoadXaml(xaml) \r\n            let t = new Task( fun() -&gt; \r\n                let task = page.Navigation.PushAsync(next)\r\n                task.Start()\r\n            )\r\n            t.RunSynchronously()\r\n        with\r\n        | _ -&gt; \r\n            label.Text &lt;- String.Format(&amp;quot;Error: cannot open {0}&amp;quot;, url )\r\n\r\n    do \r\n        let xaml = ResourceLoader.GetString(path)\r\n\r\n        page &lt;- ParseXaml.LoadXaml(xaml)\r\n\r\n        buttonNextPage &lt;- page.FindByName&lt;Button&gt;(&amp;quot;buttonNextPage&amp;quot;)\r\n        buttonStopWatch &lt;- page.FindByName&lt;Button&gt;(&amp;quot;buttonStopWatch&amp;quot;)\r\n        buttonStopWatchDownload &lt;- page.FindByName&lt;Button&gt;(&amp;quot;buttonStopWatchDownload&amp;quot;)\r\n        label &lt;- page.FindByName&lt;Label&gt;(&amp;quot;label&amp;quot;)\r\n        \r\n        buttonNextPage.Clicked.Add( fun(e) -&gt; \r\n                pushPageVM(&amp;quot;NextPage.xml&amp;quot;, new ViewModelNextPage())\r\n            )\r\n        buttonStopWatch.Clicked.Add( \r\n            fun(e) -&gt; pushPage(&amp;quot;StopWatchPage.xml&amp;quot;))\r\n\r\n        buttonStopWatchDownload.Clicked.Add( \r\n            fun(e) -&gt; pushPageDL(&amp;quot;http:\/\/moonmile.net\/up\/DownLoadPage.xml&amp;quot;))\r\n\r\n    member this.Page \r\n        with get() = page\r\n<\/pre>\n<p>Xaml \u30d5\u30a1\u30a4\u30eb\u3092\u305d\u306e\u307e\u307e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u57cb\u3081\u8fbc\u3080\u3068\u3001C# \u306e\u30b3\u30fc\u30c9\u30d3\u30cf\u30a4\u30c9\u3092\u5410\u304d\u51fa\u3059\u306e\u3067\u3001\u62e1\u5f35\u5b50\u3092 xml \u306b\u3057\u3066\u3044\u307e\u3059\u3002ViewModel \u81ea\u4f53\u306f\u3001XAML \u3092\u52d5\u7684\u306b\u751f\u6210\u3057\u3066\u7d50\u3073\u3064\u3051\u307e\u3059\u3002\u5185\u90e8\u7684\u306b\u306f\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5d50\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u6c17\u306b\u3057\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002\u5916\u5074\u304b\u3089\u4f7f\u3046\u6642\u3001ViewModel \u304b\u3089\u4f7f\u3046\u6642\u306f\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u306a\u3069\u306f\u610f\u8b58\u3057\u306a\u3044\u4f5c\u308a\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u666e\u901a\u306e ViewModel \u3092\u4f7f\u3046\u3068\u304d\u3068\u540c\u3058\u8981\u9818\u3067\u3059\u306d\u3002<\/p>\n<p>F# \u306a\u306e\u3067 Command \u30d1\u30bf\u30fc\u30f3\u306e\u3068\u3053\u308d\u304c\u3084\u3084\u3053\u3057\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001C# \u3067\u3082\u540c\u3058\u3088\u3046\u306b\u66f8\u3051\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3092\u4f7f\u3046\u306e\u3067\u3001View \u306b\u4f9d\u5b58\u3057\u306a\u3044\u3088\u3046\u306b\u66f8\u3051\u307e\u3059\u3002\u3053\u3053\u306f MVVM \u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\ntype ViewModelStopWatch() =\r\n    inherit ViewModelBase()\r\n\r\n    let mutable startTime = DateTime.Now\r\n    let mutable endTime  = DateTime.Now\r\n    let mutable time:TimeSpan = new TimeSpan()\r\n    let mutable task:Task = null\r\n    let mutable taskflag = false\r\n\r\n\r\n    \/\/\/ \u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u3067 iOS\/Android \u306e System.Timers.Timer \u3092\u6301\u3063\u3066\u304f\u308b\r\n    \/\/\/ \u73fe\u5728\u8abf\u7bc0\u4e2d\r\n    let makeTimer (interval:int, hdr:ElapsedEventHandler) =\r\n        let asm = Assembly.Load(AssemblyName(&amp;quot;System&amp;quot;))\r\n        let t = asm.GetType( &amp;quot;System.Timers.Timer&amp;quot; )\r\n        let item = System.Activator.CreateInstance(t)\r\n\r\n        t.GetRuntimeProperty(&amp;quot;Enabled&amp;quot;).SetValue( item, true )\r\n        t.GetRuntimeProperty(&amp;quot;AutoReset&amp;quot;).SetValue( item, true )\r\n        t.GetRuntimeProperty(&amp;quot;Interval&amp;quot;).SetValue( item, interval )\r\n        t.GetRuntimeEvent(&amp;quot;Elapsed&amp;quot;).AddEventHandler( item, hdr )\r\n        t.GetRuntimeMethod(&amp;quot;Start&amp;quot;, null).Invoke(item, null) |&gt; ignore\r\n        item\r\n\r\n    member this.Time \r\n        with get() =  \r\n            time &lt;- endTime - startTime\r\n            String.Format(&amp;quot;{0:00}min {1:00}sec {2:000}&amp;quot;, time.Minutes, time.Seconds, time.Milliseconds )\r\n    member this.StartTime\r\n        with get() = startTime.ToString()\r\n\r\n    member this.StartCommand \r\n        with get() =\r\n            let cmd = \r\n                new DelegateCommand(\r\n                    (fun (o) -&gt; true ),\r\n                    (fun (o) -&gt; \r\n                        startTime &lt;- DateTime.Now \r\n                        endTime &lt;- startTime\r\n                        this.OnPropertyChanged(&amp;quot;StartTime&amp;quot;)\r\n                        this.OnPropertyChanged(&amp;quot;Time&amp;quot;)\r\n                        \/\/ makeTimer(2000, new ElapsedEventHandler(fun(s,e)-&gt; \r\n                        \/\/     System.Diagnostics.Debug.WriteLine(&amp;quot;time {0}&amp;quot;, endTime ))) |&gt; ignore\r\n                        \/\/ )))\r\n                        ))\r\n            cmd\r\n\r\n    member this.StopCommand \r\n        with get() =\r\n            let cmd = \r\n                new DelegateCommand(\r\n                    (fun (o) -&gt; true ),\r\n                    (fun (o) -&gt; \r\n                        taskflag &lt;- false\r\n                        endTime &lt;- DateTime.Now \r\n                        this.OnPropertyChanged(&amp;quot;Time&amp;quot;)\r\n                    ))    \r\n            cmd\r\n\r\n    member this.ResetCommand \r\n        with get() =\r\n            let cmd = \r\n                new DelegateCommand(\r\n                    (fun (o) -&gt; true ),\r\n                    (fun (o) -&gt; \r\n                        taskflag &lt;- false\r\n                        startTime &lt;- DateTime.Now\r\n                        endTime &lt;- DateTime.Now \r\n                        this.OnPropertyChanged(&amp;quot;StartTime&amp;quot;)\r\n                        this.OnPropertyChanged(&amp;quot;Time&amp;quot;)\r\n                    ))    \r\n            cmd\r\n<\/pre>\n<p>\u3053\u3053\u3067\u30b9\u30c8\u30c3\u30d7\u30a6\u30a9\u30c3\u30c1\u3092\u4f5c\u308d\u3046\u3068\u601d\u3063\u305f\u306e\u3067\u3059\u304c\u3001Xamarin.Android \u306e\u5834\u5408\u3001Task.Delay \u306e\u6271\u3044\u304c Windows Forms \u3068\u7570\u306a\u308b\u306e\u3067\u82e6\u6226\u4e2d\u3067\u3059\u3002\u5b9f\u306f WinRT \u3082\u540c\u3058\u73fe\u8c61\u306b\u306a\u308b\u306e\u3067\u3001\u5b9a\u671f\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u8d77\u52d5\u306f\u30bf\u30a4\u30de\u30fc\u3092\u4f7f\u308f\u306a\u3044\u3068\u99c4\u76ee\u306a\u3093\u3067\u3059\u3088\u306d\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u3001\u5225\u306a\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u3068\u3057\u3066\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p>Xamarin.Forms \u3084 MvvmCross \u7684\u306b\u306f Service \u3092\u4f7f\u3046\u306e\u3067\u3057\u3087\u3046\u304c\u3001\u4eca\u56de\u306f\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u4f9d\u5b58\u306e\u30a2\u30bb\u30f3\u30d6\u30ea\u3092\u52d5\u7684\u30ed\u30fc\u30c9\u3057\u3066\u3001\u30bf\u30a4\u30de\u30fc\u30af\u30e9\u30b9\u3092\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u64cd\u4f5c\u3059\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3092\u8a66\u3057\u3066\u3044\u307e\u3059\u3002\u7d50\u69cb\u4e71\u66b4\u3067\u3059\u304c\u3001\u3053\u3046\u3059\u308b\u3068 PCL \u304b\u3089\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3078\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u3044\u3089\u306a\u304f\u306a\u3063\u3066\uff08\u30bf\u30a4\u30de\u30fc\u3092\u8d77\u52d5\u3059\u308b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u5fc5\u8981\u306a\u304f\u306a\u308b\uff09\u4f9d\u5b58\u95a2\u4fc2\u304c\u300c\u758e\u300d\u306b\u306a\u308a\u307e\u3059\u3002\u5b9f\u306f\u3001\u30bf\u30a4\u30de\u30fc\u306e\u6271\u3044\u3082\u3001Android\/iOS\/WinStore \u3068\u305d\u308c\u305e\u308c\u7570\u306a\u308b\u306e\u3067\u3001\u5de5\u592b\u304c\u5fc5\u8981\u306a\u306e\u3067\u3059\u304c\u3001Device \u3092\u4f7f\u3063\u3066\u56de\u907f\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u306e XamlTypeProvider \u306f NuGet \u3092\u4f7f\u3063\u3066\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/www.nuget.org\/packages\/Xamarin.Forms.XamlProvider\/\">https:\/\/www.nuget.org\/packages\/Xamarin.Forms.XamlProvider\/<\/a><\/p>\n<h2>\u25a0\u5b9f\u884c\u3059\u308b<\/h2>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2014\/07\/wpid-dworkblogimage20140722_01org.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2014\/07\/wpid-dworkblogimage20140722_01thum.jpg\" border=\"0\" \/><\/a><\/p>\n<p>\u300cDownload View from Internet\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u304b\u3089 XAML \u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001View \u3060\u3051\u3092\u5b9a\u671f\u7684\u306b\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2014\/07\/wpid-dworkblogimage20140722_02org.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2014\/07\/wpid-dworkblogimage20140722_02thum.jpg\" border=\"0\" \/><\/a><\/p>\n<p>XFormsPerviwer \u3082\u305d\u3046\u306a\u306e\u3067\u3059\u304c\u3001Xamarin.Forms \u306e XAML \u3092\u5916\u3060\u3057\u306b\u3057\u3066\u3044\u3064\u3067\u3082\u66f4\u65b0\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u3001\u3061\u3087\u3053\u3061\u3087\u3053\u3068 XAML \u3092\u624b\u4f5c\u696d\u3067\u4fee\u6b63\u3057\u3066\u3001\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u4e0a\u3067\u52d5\u4f5c\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u305f\u3076\u3093\u3001\u958b\u767a\u52b9\u7387\u304c\u4e0a\u304c\u308b\u304b\u306a\u3001\u3063\u3066\u306e\u3068\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0\u3068\u304b\u8a2d\u5b9a\u753b\u9762\u3092\u30c0\u30a4\u30ca\u30df\u30c3\u30af\u306b\u30ed\u30fc\u30c9\u3055\u305b\u308b\u3068\u3001\u753b\u9762\u306e\u96f0\u56f2\u6c17\u304c\u304c\u3089\u308a\u3068\u5909\u308f\u3063\u3066\u3088\u3044\u304b\u3068\u3002\u30a2\u30d7\u30ea\u81ea\u4f53\u306f\u305d\u306e\u307e\u307e\u306a\u306e\u3067\u3001\u624b\u8efd\u306b\u5909\u3048\u3089\u3048\u308b\u306e\u304c\u30df\u30bd\u3067\u3059\u3002\u305d\u3046\u3001\u3084\u3084\u3053\u3057\u3044\u300c\u5be9\u67fb\u300d\u304c\u3044\u3089\u306a\u304f\u306a\u308a\u307e\u3059\u304b\u3089\u306d\u3002<\/p>\n<p>\u3053\u306e\u4ed5\u7d44\u307f\u81ea\u4f53\u304c\u300c\u5be9\u67fb\u300d\u304c\u901a\u308b\u304b\u3089\u3069\u3046\u304b\u306f\u3001\u8fd1\u3005\u8a66\u3057\u3066\u307f\u308b\u4e88\u5b9a\u3067\u3059\u3002\u3057\u3070\u3089\u304f\u306f\u3001\u30d7\u30ec\u30d3\u30e5\u30fc\u7684\u306b\u4f7f\u3046\u306e\u3068\u3001XamlTypeProvider \u306e\u6574\u5099\u3063\u3066\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>XFormsPreviewer \u3067\u306f\u3001\u52d5\u7684\u306bXAML\u30d5\u30a1\u30a4\u30eb\u3092\u30ed\u30fc\u30c9\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\uff08\u5185\u90e8\u7684\u306b\u306fXamarin.Forms\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u751f\u6210\u3059\u308b\uff09\u3057\u3066\u30d7\u30ec\u30d3\u30e5\u30fc\u3092\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u30b3\u30a2\u30e9\u30a4\u30d6\u30e9\u30ea\u306b XamlTy &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/6045\">\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":[3],"tags":[],"class_list":["post-6045","post","type-post","status-publish","format-standard","hentry","category-dev"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6045","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=6045"}],"version-history":[{"count":3,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6045\/revisions"}],"predecessor-version":[{"id":6046,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6045\/revisions\/6046"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=6045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=6045"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=6045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}