good morning everyone, sorry but I'm a very very newbie and I don't even know how to ask the right questions.
I wanted to ask if there is a possibility to create a binding for the shadow properties of a control (eg. a button)
Something that could look like this. thanks to everyone.
C#
public class shadow
{
public string brush { get; set; } = "Black";
public string offset { get; set; } = "20,20";
public string radius { get; set; } = "10";
public string opacity { get; set; } = "0.7";
}public class shadow
{ public string brush { get; set; } = "Black"; public string offset { get; set; } = "20,20"; public string radius { get; set; } = "10"; public string opacity { get; set; } = "0.7"; } ```


Naimish MakwanaRank #324 · 7.7K reputationPosted Aug 29, 2024, 9:06 AM EDT
Yes, you can create bindings for the shadow properties of a control like a button in XAML. Here’s how you can do it:
public class Shadow { public string Brush { get; set; } = "Black"; public string Offset { get; set; } = "20,20"; public string Radius { get; set; } = "10"; public string Opacity { get; set; } = "0.7"; }Shadowclass and set it as the BindingContext.public partial class MainPage : ContentPage { public Shadow ButtonShadow { get; set; } public MainPage() { InitializeComponent(); ButtonShadow = new Shadow(); BindingContext = this; } }{Binding}markup extension to bind the properties of theShadowclass to the shadow properties of the button.This setup allows you to bind the shadow properties of the button to the properties defined in your
Shadowclass. You can then update the properties of theShadowinstance, and the changes will be reflected in the button’s shadow.Thanks
Vicente Gerardo Guzman LucioRank #1,544 · 1K reputationPosted Sep 1, 2024, 8:29 PM EDT
Do you have a repository of a working example?