Xamarin.Forms の Shared プロジェクトで Page に カスタム View を配置するため、下記のような XAML を記述したらエラー!
<ContentPage x:Class="XamarinSample.Views.TopPage" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:view="clr-namespace:XamarinSample.Views;assembly=XamarinSample"> <view:ArcStepper /> </ContentPage>
アセンブリが見つからない・・・
アセンブリ名が「FormsTemplateiOS」になってるー!
案の定先ほどの XAML を下記のように書き換えたら動きました・・・が、これじゃあ共通化できない!
<ContentPage x:Class="XamarinSample.Views.TopPage" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:view="clr-namespace:XamarinSample.Views;assembly=FormsTemplateiOS"> <view:ArcStepper /> </ContentPage>
今度は XAML をもとに戻してから試しに iOS のアセンブリ名を「XamarinSample」に合わせて実行すると・・・これも動きました
でもこれだと dll をすべてのプラットフォームで同じしないといけないので微妙ですね;
Shared より共通部分を別アセンブリ化する PCL プロジェクトの方がいいのかもしれない;
ユニバーサル Windows アプリでは Xamarin と異なり xmlns の指定にアセンブリ名がいらないので問題ないんですけどね・・・・