Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Applying a background for the control in an Effect

$
0
0

I'm trying to apply a background for what ever the control the effect is attached to.

First i made the effect to apply a background for the controls that have either a Fill or Background properties in UWP.
But the problem is a lot of controls renderes to FrameworkElement in UWP. And FrameworkElement doesn't have a Background property .
In the VisualElementRenderer Xamarin forms adresses this issue be applying a background layer behind the content but this is an effect.
Is there is any way to apply a background for whatever the effect is attached to?
I'm appplying an AcrylicBrush So it must be assigned to the Control directly.

The code i written before:
try
{
Control.GetType().GetProperty("Background").SetValue(Control, brush);
}
catch
{
Control.GetType().GetProperty("Fill").SetValue(Control, brush);
}


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>