Error when binding using markup extensions: Unknown property encountered while parsing a Markup Extension Error when binding using markup extensions: Unknown property encountered while parsing a Markup Extension wpf wpf

Error when binding using markup extensions: Unknown property encountered while parsing a Markup Extension


WPF doesn't handle nested markup extensions too well. To overcome this, you can use your markup extension as an element. It's a bit clumsy and harder to read, but it works:

<RadioButton GroupName="F1" Content="Filter Number One">    <RadioButton.IsChecked>        <Binding Path="Filter">            <Binding.Converter>                <local:TrueWhenEqual To={x:Static local:ViewModelClass.Filter1} />            </Binding.Converter>        </Binding>    </RadioButton.IsChecked></RadioButton>

Another way would be to declare your converter and use it as a static resource:

<Window.Resources>    <local:TrueWhenEqual To={x:Static local:ViewModelClass.Filter1} x:Key="myConverter" /></Window.Resources><RadioButton GroupName="F1" Content="Filter Number One"             IsChecked="{Binding Filter, Converter={StaticResource myConverter}}" />


I encountered the same bug on a machine with .NET 4.6 installed. As soon as I updated to the .NET 4.7 (Developer Pack) this error gone without any code changes.