I have a Xamarin.Forms.Image
subclass with custom renderers for iOS and Android that render a subclass of UIView and View respectively.
I'd like to use it in a ToolbarItem
, but can't figure out how to make a subclass of ImageSource
to load my custom subclass's rendered Image
instead of some PNG from the file system. I can't use any of the standard ImageSource
s since this is a custom view with custom renderers.
I've tried to subclass ToolbarItem
and give it a CustomSource
bindable property, but the app crashes when it loads up the page:
<ContentPage.ToolbarItems>
<CustomToolbarItem CustomSource="customsource" Command="{Binding CustomToolbarItemCommand}"/>
</ContentPage.ToolbarItems>
Or is there a better way?
On iOS it's easy since a ToolbarItem's equivalent there can display any UIView as its content. But it doesn't seem to be possible in Xamarin.Forms.
TIA