Is there a way to add binding in Value section of data Trigger

stXamDevstXamDev Member ✭✭
edited April 24 in Xamarin.Forms

Best Answer

Answers

  • TaylorDTaylorD USMember ✭✭✭

    Here is the code from the post formatted properly.

    <DataTrigger TargetType="StackLayout" Binding="{Binding IsRAFlagVisible}" Value="{Binding MyVariable}">
        <Setter Property="BackgroundColor" Value="DarkGray"/>
    </DataTrigger>
    
  • LandLuLandLu Member, Xamarin Team Xamurai

    Is this what you are looking for https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/triggers#data-triggers?
    It specifies how to use binding in data trigger.

  • stXamDevstXamDev Member ✭✭

    @TaylorD Thanks
    @LandLu In the code I need to bind the Value field from the code and not as a static value

Sign In or Register to comment.