Hi There
So I found myself making a bunch of views that have very similar functionality and wanted to make them extend from a base class. Originally these were custom XAML extending ContentView:
<ContentView xmlns="//xamarin.com/schemas/2014/forms"
xmlns:x="//schemas.microsoft.com/winfx/2009/xaml"
xmlns:layouts="clr-namespace:MyApp.Layouts"
x:Class="MyApp.Layouts.CommentPopUp">
//Content
</ContentView>
What I was hoping I could do, was make a new class PopUpBase that extended from ContentView and implemented some of the functionality for these views, then extend that. I'm not sure how to refer to it though, trying it like this compiles but crashes when the view is displayed:
<layouts:PopUpBase xmlns="//xamarin.com/schemas/2014/forms"
xmlns:x="//schemas.microsoft.com/winfx/2009/xaml"
xmlns:layouts="clr-namespace:MyApp.Layouts"
x:Class="MyApp.Layouts.CommentPopUp">
//Content
</layouts:PopUpBase>
Is this possible? If so, how? If not, what alternatives do I have to writing out identical code for each layout?
Thanks