Adding Data Trigger to Controls?

I was trying to add a DataTrigger to a BarPointer on my LinearGauge and it does not seem to be possible.

Normally you could go about it this way on a standard Maui view:

    Initialize your label
    Label totalAmountLabel = new Label();
    totalAmountLabel.SetBinding(Label.TextProperty, new Binding("TotalAmount"));


    // Create a DataTrigger
    DataTrigger dataTrigger = new DataTrigger(typeof(Label));
    dataTrigger.Binding = new Binding("IsTotalAmountHigh");
    dataTrigger.Value = true;
    dataTrigger.Setters.Add(new Setter { Property = Label.TextColorProperty, Value = Color.Red });


    // Add the DataTrigger to your Label
    totalAmountLabel.Triggers.Add(dataTrigger);


If I try to do this with a BarPointer, it simply does not allow it. There is no Triggers option to select. 

Is there no way to do this with Syncfusion controls?


1 Reply

VO Vishal Omprasad Syncfusion Team July 21, 2023 01:25 PM UTC

Hi Bella,

As per the current implementation, the .NET MAUi SfLinearGauge control does not have support to add Data Triggers for the pointers.

If you have any further questions or require assistance with any other aspect, please don’t hesitate to let us know. We are here to help.

Regards,

Vishal O.


Loader.
Up arrow icon