Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Apply Custom Renderer Without ExportRenderer Attribute

$
0
0

The normal way to apply a platform specific custom renderer is like this:

[assembly: ExportRenderer(typeof(PlatformSpecificContentPage), typeof(UWPContentPageRenderer))]

This blanket affects all classes of type PlatformSpecificContentPage in the system. But, I want to be able to apply a custom renderer to say "Entry" controls through Xaml. e.g. in some cases, I want to replace an TextBox in UWP with a custom control that has syntax highlighting, but not in all cases. The problem with the ExportRendererAttribute is that I have to inherit from Entry in order to apply the custom renderer. This is a pretty silly design flaw of the system.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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