Hello EduardoGomez-1870,
Welcome to our Microsoft Q&A platform!
If the FFImageLoading doesn't support to work with Triggers
, you could create an attached behavior to update the transfromation.
Here is the sample code, you could refer to:
public static class GrayscaleTransformationBehavior
{
public static readonly BindableProperty AttachBehaviorProperty = BindableProperty.CreateAttached("AttachBehavior", typeof(bool), typeof(GrayscaleTransformationBehavior), true, propertyChanged: OnAttachBehaviorChanged);
public static bool GetAttachBehavior(BindableObject view)
{
return (bool)view.GetValue(AttachBehaviorProperty);
}
public static void SetAttachBehavior(BindableObject view, bool value)
{
view.SetValue(AttachBehaviorProperty, value);
}
static void OnAttachBehaviorChanged(BindableObject view, object oldValue, object newValue)
{
var cachedImage = view as CachedImage;
if (cachedImage == null)
{
return;
}
bool attachBehavior = (bool)newValue;
if (!attachBehavior)
{
cachedImage.Transformations = new List<ITransformation>()
{
new GrayscaleTransformation()
};
}
else
{
cachedImage.Transformations = new List<ITransformation>()
{
};
}
}
}
Set binding to the attach behavior property
<ffimageloading:CachedImage x:Name="cachedImage" Source="yali" local:GrayscaleTransformationBehavior.AttachBehavior="{Binding Status}">
</ffimageloading:CachedImage>
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.