I was trying to use the MaterialEntry in Xamarin Form project.
I created a custom control which inherit MatrialEntry to set the default AccentColor.
public class MyMaterialEntry : MaterialEntry
{
public MyMaterialEntry()
{
this.AccentColor = (Color)App.Current.Resources["AccentColor"];
}
}
Then I use MyMaterialEntry in XAML and run the Android client.
Then exception throw.
06-07 11:50:41.141 E/mono-rt (22891): [ERROR] FATAL UNHANDLED EXCEPTION: Xamarin.Forms.Xaml.XamlParseException: Position 13:14. Type views:BorderlessEntry not found in xmlns clr-namespace:SuaveControls.MaterialForms
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x00040] in D:\a\1\s\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:50
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000ac] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:149
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00079] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:145
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00044] in D:\a\1\s\Xamarin.Forms.Xaml\XamlNode.cs:200
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydrationContext visitorContext) [0x00054] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:140
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml) [0x00058] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:89
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.Type callingType) [0x00026] in D:\a\1\s\Xamarin.Forms.Xaml\XamlLoader.cs:67
06-07 11:50:41.141 E/mono-rt (22891): at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.Type callingType) [0x00000] in D:\a\1\s\Xamarin.Forms.Xaml\ViewExtensions.cs:36
06-07 11:50:41.141 E/mono-rt (22891): at SuaveControls.MaterialForms.MaterialEntry.InitializeComponent () [0x00000] in <2e979f815d6a4604a84fcc9b7c5e80c5>:0
06-07 11:50:41.141 E/mono-rt (22891): at SuaveControls.MaterialForms.MaterialEntry..ctor () [0x00006] in <2e979f815d6a4604a84fcc9b7c5e80c5>:0
06-07 11:50:41.141 E/mono-rt (22891): at NWCMobileApp.UserControl.BasicControl.MyMaterialEntry..ctor () [0x00000] in C:\Users\jimmypun\source\repos\NWCMobileApp\NWCMobileApp\NWCMobileApp\UserControl\BasicControl\MyMaterialEntry.cs:11
06-07 11:50:41.141 E/mono-rt (22891): at NWCMobileApp.Pages.Account.LoginPage.InitializeComponent () [0x00067] in C:\Users\jimmypun\source\repos\NWCMobileApp\NWCMobileApp\NWCMobileApp\obj\Debug
etstandard2.0\Pages\Account\LoginPage.xaml.g.cs:42
In MainActivity.cs, I added the Init before/after Forms.Init, but still no luck
SuaveControls.MaterialForms.Android.Renderers.BorderlessEntryRenderer.Init();
SuaveControls.MaterialForms.Android.RendererInitializer.Init();
I was trying to use the MaterialEntry in Xamarin Form project.
I created a custom control which inherit MatrialEntry to set the default AccentColor.
Then I use MyMaterialEntry in XAML and run the Android client.
Then exception throw.
In MainActivity.cs, I added the Init before/after Forms.Init, but still no luck