String comparison with QuickConverter

QuickConverter uses single quote for string literals. However within the markup extension you need to escape the single quote, so you need to add \ before it.

So your binding should be

Binding="{qc:Binding '$P==\'Verified\'',P={Binding Path=Idea.Status}}"

I did it this way. It works the same as the chosen answer, but the xaml parser is much happier and doesn't throw annoyng (fake) errors

Binding="{Path=Idea.Status, Converter={qc:QuickConverter '$P == \'Verified\''}}"

The only way i can came up with is by using the qc:MultiBinding

<Grid>
    <Button Content="Hi There !"  VerticalAlignment=" Center" HorizontalAlignment="Center" IsEnabled="{qc:MultiBinding '$P0 == $P1', P0={Binding Status}, P1={Binding Verified}}"></Button>
</Grid>

Verified is defined as a property in the ViewModel/CodeBehind

public String Verified { get; set; }

here the full code behind

 public partial class MainWindow : Window,INotifyPropertyChanged
{
    public String Verified = "Verified";

    private String _status = "Verified";
    public String Status
    {
        get
        {
            return _status;
        }

        set
        {
            if (_status == value)
            {
                return;
            }

            _status = value;
            OnPropertyChanged();
        }
    }
    public MainWindow()
    {
        InitializeComponent();

    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        PropertyChangedEventHandler handler = PropertyChanged;
        if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    }
}

Tags:

C#

Wpf

Xaml