I tried to use the custom control by XAML. For example:
<?xml version="1.0" encoding="UTF-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:customs="clr-namespace:Customs;assembly=Customs"
x:Class="FormsCustomControl.MainPage">
<ContentPage.Content>
<customs:CustomControl />
</ContentPage.Content>
</ContentPage>
But the app threw a System.IO.FileNotFoundException
with this messages.
On the other hand, the error no longer occurs when i add somewhere the c# code that refers to my Customs
assembly. For example:
using Xamarin.Forms;
namespace FormsCustomControl
{
public partial class MainPage : ContentPage
{
public MainPage ()
{
new Customs.CustomControl();
InitializeComponent ();
}
}
}
How can I do to so that you can use a custom control using only XAML?