Iyon_Groznyy

Untitled

Apr 6th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. using Android.Content.Res;
  2. using Android.Widget;
  3. using Kdd.IdaCare.Mobile.Common.Enums;
  4. using Kdd.IdaCare.Mobile.Droid.Extensions;
  5. using MvvmCross.Binding;
  6. using MvvmCross.Binding.Bindings.Target;
  7.  
  8. namespace Kdd.IdaCare.Mobile.Droid.TargetBindings
  9. {
  10. public class ImageViewTintColorTargetBinding : MvxTargetBinding<ImageView, AppColor>
  11. {
  12. public ImageViewTintColorTargetBinding(ImageView target)
  13. : base(target)
  14. {
  15. }
  16.  
  17. public override MvxBindingMode DefaultMode => MvxBindingMode.OneWay;
  18.  
  19. protected override void SetValue(AppColor value)
  20. {
  21. var color = value.ToAndroidColor();
  22. Target.ImageTintList = ColorStateList.ValueOf(color);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment