usingSystem;usingSystem.Reflection;usingXamarin.Forms;usingXamarin.Forms.Xaml;namespaceSampleApp{[ContentProperty(nameof(Source))]publicclassImageResourceExtension:IMarkupExtension{publicstringSource{get;set;}publicobjectProvideValue(IServiceProviderserviceProvider){if(Source==null){returnnull;}// Do your translation lookup here, using whatever method you requirevarimageSource=ImageSource.FromResource(Source,typeof(ImageResourceExtension).GetTypeInfo().Assembly);returnimageSource;}}}