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

Creating a custom control in Xamarin.Forms

$
0
0

Looking through the discussions on creating custom views, it seems I need to use ViewRenderer. In my Android project, this isn't defined, so I get compilation errors.

using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

namespace CustomStuff.Android.Renderers
{
    public class SongViewRenderer
    {
        public SongViewRenderer () : ViewRenderer<SongView, View>
        {
        }
    }
}

I see "Error CS1018: Keyword 'this' or 'base' expected (CS1018)" straight after ViewRenderer<SongView, View>. Usually I use Resolve to fix this but that doesn't appear if I right click on ViewRenderer.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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