ImageEffects.cs 820 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using UIKit;
  6. using Xamarin.Forms;
  7. using Xamarin.Forms.Platform.iOS;
  8. using XamarinFormsGoogleDriveAPI.Effects;
  9. using XamarinFormsGoogleDriveAPI.iOS.Effects;
  10. [assembly: ResolutionGroupName("GoogleDrive")]
  11. [assembly: ExportEffect(typeof(ImageEffects), "ImageEffects")]
  12. namespace XamarinFormsGoogleDriveAPI.iOS.Effects
  13. {
  14. public class ImageEffects : PlatformEffect
  15. {
  16. protected override void OnAttached()
  17. {
  18. var imageView = Control as UIImageView;
  19. var tintEffect = (TintEffect) Element.Effects.FirstOrDefault(row => row is TintEffect);
  20. imageView.TintColor = tintEffect.TintColor.ToUIColor();
  21. }
  22. protected override void OnDetached()
  23. {
  24. }
  25. }
  26. }