XAML from Metro Studio not work in Xamarin Forms

Hi I tried use xaml generated by Metro Studio in Xamarin App but not work. It´s not compatible with Form ?



Xamarin.Forms.Xaml.XamlParseException
  HResult=0x80131500
  Message=Position 1:242. Type Rectangle not found in xmlns http://schemas.microsoft.com/winfx/2006/xaml/presentation
  Source=Xamarin.Forms.Xaml
  StackTrace:
   at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit(ElementNode node, INode parentNode)
   at Xamarin.Forms.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
   at Xamarin.Forms.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
   at Xamarin.Forms.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
   at Xamarin.Forms.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
   at Xamarin.Forms.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
   at Xamarin.Forms.Xaml.XamlLoader.Visit(RootNode rootnode, HydrationContext visitorContext)
   at Xamarin.Forms.Xaml.XamlLoader.Load(Object view, String xaml)
   at Xamarin.Forms.Xaml.ResourcesLoader.CreateFromResource[T](String resourcePath, Assembly assembly, IXmlLineInfo lineInfo)
   at Xamarin.Forms.ResourceDictionary.SetAndLoadSource(Uri value, String resourcePath, Assembly assembly, IXmlLineInfo lineInfo)
   at App2.MainPage.InitializeComponent() in C:\Users\scf\source\repos\App2\App2\App2\obj\Debug\netstandard2.0\MainPage.xaml.g.cs:line 26
   at App2.MainPage..ctor() in C:\Users\scf\source\repos\App2\App2\App2\MainPage.xaml.cs:line 14
   at App2.App..ctor() in C:\Users\scf\source\repos\App2\App2\App2\App.xaml.cs:line 14
   at App2.UWP.MainPage..ctor() in C:\Users\scf\source\repos\App2\App2\App2.UWP\MainPage.xaml.cs:line 24
   at App2.UWP.App2_UWP_XamlTypeInfo.XamlTypeInfoProvider.Activate_4_MainPage() in C:\Users\scf\source\repos\App2\App2\App2.UWP\obj\x86\Debug\XamlTypeInfo.g.cs:line 255
   at App2.UWP.App2_UWP_XamlTypeInfo.XamlUserType.ActivateInstance() in C:\Users\scf\source\repos\App2\App2\App2.UWP\obj\x86\Debug\XamlTypeInfo.g.cs:line 480


Attachment: App2_7c91c283.zip

1 Reply

PA Paul Anderson S Syncfusion Team September 10, 2018 05:12 AM UTC

Hi Sergio, 
 
Greetings from Syncfusion. 
 
We have checked your requirement of having the Xaml Font File to provide directly in Xamarin Forms and the xaml file from the MetroStudio has been created for WPF and UWP platforms which have different namespaces for Rectangle, Eclipse, Patch, Transform which is not supported in Xamarin Forms. 
 
To use the Font Icons in Xamarin Forms we have to export the FontIcon from the MetroStudio as in the below link. 
 
 
Using the generated Font file of type .ttf we can attach to the Xamarin.Forms project and can be used in the supported controls. 
 
We have to define the FontIcon FontFamily with different type for Android, iOS and UWP. So we have defined as common in the ResourceDictionary and used in the SfTabView.  
  
<ResourceDictionary>   
<OnPlatform x:TypeArguments="x:String" x:Key="fontFamily" iOS="TabIcons" Android="TabIcons.ttf" UWP="TabIcons.ttf#TabIcons" />   
</ResourceDictionary>   
// . . . //   
<tabview:SfTabItem Title="Calls" IconFont="a" FontIconFontColor="LightBlue" FontIconFontSize="20" FontIconFontFamily="{StaticResource fontFamily}"/>  
  
   
We have created a sample for adding the Icons in the TabHeader. Please have the sample from the following link  
  
  
Please read the given instruction for how to add the font icons from the following link  
  
  
Regards, 
Paul Anderson 


Loader.
Up arrow icon