{"id":6019,"date":"2014-07-07T01:37:59","date_gmt":"2014-07-06T16:37:59","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=6019"},"modified":"2014-07-07T01:37:59","modified_gmt":"2014-07-06T16:37:59","slug":"xamarin-forms%e3%81%b8%e5%8b%95%e7%9a%84%e3%81%abxaml%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e3%83%ad%e3%83%bc%e3%83%89%e3%81%99%e3%82%8b-%e3%81%ae%e6%89%8b%e5%a7%8b%e3%82%81","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/6019","title":{"rendered":"Xamarin.Forms\u3078\u52d5\u7684\u306bXAML\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3059\u308b&#8230;\u306e\u624b\u59cb\u3081"},"content":{"rendered":"<p>\u7b2c1\u56de Xamarin User Group \u306f\u7121\u4e8b\u7d42\u4e86\u3002\u30d7\u30ec\u30bc\u30f3\u8cc7\u6599\u306b\u3064\u3044\u3066\u306f\u5f8c\u307b\u3069\u89e3\u8aac\u3092\u5165\u308c\u308b\u3068\u3057\u3066\u3001\u306a\u306b\u304b\u3068\u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u624b\u3092\u4ed8\u3051\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>Xamarin.Forms \u3092\u4f7f\u3046\u3068\u304d\u3001Phone \u306e\u5834\u5408\u306f\u753b\u9762\u304c\u72ed\u3044\u306e\u3067\u624b\u6253\u3061\u3067 XAML \u3092\u66f8\u3044\u3066\u3082\u306a\u3093\u3068\u304b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u30bf\u30d6\u30ec\u30c3\u30c8\u306e\u3088\u3046\u306b\u5e83\u3044\u753b\u9762\u306b\u306a\u3063\u305f\u6642\u3084\u3001Xcode \u306e autolayout \u307f\u305f\u3044\u306a\u611f\u3058\u3067\u30ec\u30a4\u30a2\u30a6\u30c8\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u624b\u6253\u3061 XAML \u3060\u3051\u3060\u3068\u7d50\u69cb\u5927\u5909\u3067\u3059\u3002\u5b9f\u884c\u3057\u306a\u3044\u3068\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3057\u3001\u61c7\u89aa\u4f1a\u3067\u3082\u30ec\u30a4\u30a2\u30a6\u30c8\u306b\u82e6\u52b4\u3057\u3066\u3044\u308b\u5834\u9762\u3082\u3042\u3063\u305f\u308a\u3057\u3066\u3001<\/p>\n<ul>\n<li>\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u3067\u5b9f\u884c\u3057\u3066\u307f\u306a\u3044\u3068\u3001\u30bf\u30b0\u306e typo \u304c\u5206\u304b\u3089\u306a\u3044\u3002\n<li>\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u3067\u5b9f\u884c\u3057\u3066\u307f\u306a\u3044\u3068\u3001\u30ec\u30a4\u30a2\u30a6\u30c8\u5d29\u308c\u304c\u308f\u304b\u3089\u306a\u3044\u3002<\/li>\n<\/ul>\n<p>\u306e\u306f\u3001\u3044\u304b\u3093\u3068\u3082\u3057\u304c\u305f\u3044\u3068\u3053\u308d\u3002Xamarin.Forms \u7528\u306e\u30c7\u30b6\u30a4\u30ca\u304c\u51fa\u308c\u3070\u3044\u3044\u3093\u3067\u3059\u304c\u3001\u66ab\u304f\u306f\u51fa\u308b\u69d8\u5b50\u3082\u306a\u3044\u306e\u3067\u3001\u306a\u3093\u3068\u304b\u306a\u3089\u3093\u304b\u306a\u3068\u3002\u305d\u3053\u306b\u3001\u300c\u30d7\u30ec\u30d3\u30e5\u30fc\u3067\u3082\u3042\u308c\u3070\u4fbf\u5229\u306a\u306e\u306b\u300d\u3068\u306e\u30c4\u30a4\u30fc\u30c8\u3092\u898b\u3064\u3051\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u308b\u307b\u3069\u3001\u30c7\u30b6\u30a4\u30f3\u81ea\u4f53\u306f\u5927\u5909\u305d\u3046\u3060\u3051\u3069\u3001\u30d7\u30ec\u30d3\u30e5\u30fc\u3060\u3051\u306a\u3089\u306a\u3093\u3068\u304b\u306a\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<ol>\n<li>Xamarin.Froms \u306e XAML \u3092\u624b\u6253\u3061\u3059\u308b\u3002\n<li>\u66f4\u65b0\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u53d6\u3063\u3066\u3001\u30c7\u30b6\u30a4\u30ca\u306b\u63cf\u753b\u3059\u308b\u3002<\/li>\n<\/ol>\n<p>\u7a0b\u5ea6\u306e\u7e70\u308a\u8fd4\u3057\u304c\u3067\u304d\u308c\u3070\u3088\u3044\u308f\u3051\u3067\u3001\u305d\u306e\u30b5\u30a4\u30af\u30eb\u304c\u65e9\u304f\u56de\u308c\u3070 try &amp; error \u3082\u9032\u307f\u305d\u3046\u3002\u3067\u3001\u306a\u306b\u304b\u65b9\u6cd5\u306f\u306a\u3044\u304b\u3068\u601d\u3063\u3066\u3001\u3072\u3068\u3064\u601d\u3044\u3064\u3044\u305f\u306e\u304c\u3001<\/p>\n<ol>\n<li>\u30c7\u30b6\u30a4\u30f3\u7528\u306e XAML \u3092\u624b\u6253\u3061\u3059\u308b\u3002\n<li>\u306a\u3093\u3089\u304b\u306e\u5f62\u3067 iOS\/Android \u306e\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u306b\u30a2\u30c3\u30d7\u3002\u3042\u308b\u3044\u306f\u3001\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u304b\u3089\u30d7\u30eb\u3002\n<li>\u306a\u3093\u3089\u304b\u306e\u5f62\u3067\u3001\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u4e0a\u3067 XAML \u3092\u89e3\u6790\u3057\u3066\u3001\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002<\/li>\n<\/ol>\n<p>\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002\u30d7\u30ec\u30d3\u30e5\u30fc\u81ea\u4f53\u3092\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u5185\u3067\u52d5\u304b\u3057\u3066\u3057\u307e\u3048\u3070\u3088\u3044\u306e\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2014\/07\/image.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2014\/07\/image_thumb.png\" width=\"640\" height=\"449\"><\/a><\/p>\n<p>\u5e78\u3044\u306b\u3057\u3066\u3001Xamarin.Forms \u306e\u5834\u5408\u306f\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5171\u901a\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u30da\u30fc\u30b8\u3068\u3057\u3066 Xamarin.Forms \u306e ContentPage \u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5927\u62b5\u306f PCL \u3067\u4f5c\u308b\u3093\u3067\u3059\u304c\u3001\u3053\u306e new ContentPage \u3057\u305f\u3082\u306e\u3092\u3001iOS\/Android \u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u6bce\u306b\u518d\u69cb\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u306a\u3089\u3070\u3001\u3053\u306e new ContentPage \u306e\u3068\u3053\u308d\u3092\u3059\u308a\u66ff\u3048\u3066\u3057\u307e\u3048\u3070\u3001\u826f\u3044\u308f\u3051\u3067\u5b9f\u969b\u3001XAML \u306e\u307b\u3046\u3067\u306f\u306a\u304f\u3066\u3001\u30b3\u30fc\u30c9\u3067\u3061\u307e\u3061\u307e\u3068 ContentPage \u3092\u4f5c\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u3092\u3001XAML \u304b\u3089\u4f5c\u308a\u8fbc\u3081\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u826f\u3044\u308f\u3051\u3067\u3059\u3002<\/p>\n<pre>namespace XFormsPreview\n{\n    public partial class MainPage\n    {\n        public MainPage()\n        {\n            InitializeComponent();\n        }\n\n        void OnClickPreview(object sender, EventArgs e)\n        {\n            \/\/ var page = new NewPage();\n            string xml = @\"&lt;?xml version='1.0' encoding='utf-8' ?&gt;\n&lt;Contentpage x:class=\"XFormsPreview.NewPage\" <br> xmlns:x=<a href=\"http:\/\/schemas.microsoft.com\/winfx\/2009\/xaml\">http:\/\/schemas.microsoft.com\/winfx\/2009\/xaml<\/a> <br> xmlns=\"http:\/\/xamarin.com\/schemas\/2014\/forms\"&gt;\n\t&lt;Stacklayout&gt;\n\t&lt;Label Text=\"New Page\"&gt;\n\t&lt;Button Text=\"click me\"&gt;\n\t&lt;\/Stacklayout&gt;\n&lt;\/Contentpage&gt;\n\";\n            var page = ContentPageXaml.LoadXaml(xml);\n            this.Navigation.PushAsync(page);\n        }\n    }\n}\n<\/pre>\n<p>\u3053\u3093\u306a\u98a8\u306b\u6587\u5b57\u5217\u3067 XAML \u3092\u8a2d\u5b9a\u3057\u3066 LoadXml \u3059\u308b\u3068 ContentPage \u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u3053\u3053\u306f F# \u306e Type Provider \u3068\u4f3c\u305f\u611f\u3058\u3067\u3059\u306d\u3002<\/p>\n<p>\u307e\u3060\u30c6\u30b9\u30c8\u4e2d\u306a\u306e\u3067\u3001XAML \u306e\u6587\u5b57\u3092\u57cb\u3081\u8fbc\u3093\u3067\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u3092\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u306e\u52d5\u3044\u3066\u3044\u308b PC \u304b\u3089 XAML \u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u3001XAML \u306e\u4fee\u6b63\u3068\u30d7\u30ec\u30d3\u30e5\u30fc\u306e\u30b5\u30a4\u30af\u30eb\u304c\u65e9\u304f\u306a\u308a\u307e\u3059\u3002\u5927\u307e\u304b\u306e\u52d5\u304d\u306e\u76ee\u9014\u306f\u7acb\u3063\u305f\u306e\u3067\u3001\u3042\u3068\u306f\u3061\u307e\u3061\u307e\u3068 Xmarin.Forms \u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u79fb\u3057\u66ff\u3048\u3066\u3044\u304d\u307e\u3059\u3002\u8eca\u8f2a\u306e\u518d\u767a\u660e\u3088\u3046\u306a\u611f\u3058\u3082\u3059\u308b\u3057\u3001\u65e2\u306b\u3042\u308b\u3088\u3046\u306a\u6c17\u3082\u3059\u308b\u3057\u3001\u672c\u683c\u7684\u306a\u30c7\u30b6\u30a4\u30ca\u304c\u51fa\u308b\u307e\u3067\u306e\u77ed\u3044\u9593\u3068\u3044\u3046\u8a33\u3067\u3082\u3042\u308b\u3051\u3069\u3001\u3072\u3068\u307e\u305a\u3001\u4e00\u901a\u308a\u52d5\u304f\u3068\u3053\u308d\u307e\u3067\u4f5c\u3063\u3066\u307f\u308b\u4e88\u5b9a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c1\u56de Xamarin User Group \u306f\u7121\u4e8b\u7d42\u4e86\u3002\u30d7\u30ec\u30bc\u30f3\u8cc7\u6599\u306b\u3064\u3044\u3066\u306f\u5f8c\u307b\u3069\u89e3\u8aac\u3092\u5165\u308c\u308b\u3068\u3057\u3066\u3001\u306a\u306b\u304b\u3068\u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u624b\u3092\u4ed8\u3051\u3066\u307f\u307e\u3057\u305f\u3002 Xamarin.Forms \u3092\u4f7f\u3046\u3068\u304d\u3001Phone \u306e\u5834\u5408\u306f &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/6019\">\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,62],"tags":[],"class_list":["post-6019","post","type-post","status-publish","format-standard","hentry","category-csharp","category-xamarin"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6019","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=6019"}],"version-history":[{"count":0,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/6019\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=6019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=6019"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=6019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}