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

Inheritance On ContentViews \ Page

$
0
0

I want some of my ContentViews to have a common custom constructor, for example;

        public ContentViewName(BindableObject indexview) : this()
        {
            BindingContext = indexview.BindingContext;
        }

but the partial class already inherits from ContentView (c# only allows one parent class, and an interface wouldn't help here).

The work around I thought of was to create a custom Contentview, which includes this constructor and derive from that.

How can this be achieved? (I have tried and failed)


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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