Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Generic in custom page (XAML)

$
0
0

Hello!
Can I use generic in custom page? As here:

public class UpdatableContentPage<TModel> : ContentPage, IUpdatable where TModel : BaseViewModel
{
.....some code here
}

And then in xaml file

<baseView:UpdatableContentPage x:TypeArguments="pageModels:TestPageModel" xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                     xmlns:baseView="clr-namespace:Framework.UI.BaseView;assembly=Framework"
                     xmlns:pageModels="clr-namespace:MyProject.Models.PageModels;assembly=MyProject"
                     x:Class="MyProject.View.TestPage">

Now i get error :( :

Xamarin.Forms.Xaml.XamlParseException: Type baseView:UpdatableContentPage not found in xmlns clr-namespace:Framework.UI.BaseView;assembly=Framework
2015-02-23 17:08:28.835 MyProjectiOS[1618:50278] Unhandled managed exception: Type baseView:UpdatableContentPage not found in xmlns clr-namespace:Framework.UI.BaseView;assembly=Framework (Xamarin.Forms.Xaml.XamlParseException)
  at Xamarin.Forms.Xaml.XamlParser.GetElementType (Xamarin.Forms.Xaml.XmlType xmlType, IXmlLineInfo xmlInfo) [0x00000] in <filename unknown>:0

P.S. for non generic custom page it's work.


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>