Check out example codes for "wpf datatrigger enum binding". It will help you in understanding the concepts better.

Code Example 1

//This example assumes enum and classes are in the same namespace
//If yours are not, use using statements and dot notation
//(Based on an answer from )

//Code-behind, C#
public enum EnumVals

public partial class MyUserControl : UserControl
        private MyDataContext myDC;

        public MyUserControl()
            myDC = new MyDataContext();
            this.DataContext = myDC;
//Helper class
public class MyDataContext : DependencyObject
        public static readonly DependencyProperty CurStateProperty = DependencyProperty.Register("CurState", typeof(EnumVals), typeof(MyDataContext), new UIPropertyMetadata(EnumVals.Excellent));

        public EnumVals CurState
            get => (EnumVals)GetValue(CurStateProperty);
            set => SetValue(CurStateProperty, value);


//XAML file snippet. Using the example of changing the fill of a polygon
//based on the value of the enum
        <Style TargetType="{x:Type Polygon}">
                <DataTrigger Binding="{Binding CurState}" Value="Excellent">
                    <Setter Property="Fill" Value="LimeGreen"/>
                <DataTrigger Binding="{Binding Path=CurState}" Value="Poor">
                    <Setter Property="Fill" Value="Red"/>

Learn ReactJs, React Native from