First you break DataContext
inheritance in your control by setting DataContext = this;
in the constructor of your PercentageOrFixControl
, so the expression
PercentageOrFixed="{Binding }"
is returning the control itself and not the PercentageOrFixed
item that is in the collection. The data context for the label is the item of the collection and that's why it finds the Name
property.
After removing the setter for data context from constructor, inner bindings in the control break since they look for properties on the control. Add
, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}
to the end of all bindings. For example, the IsChecked
property of the first RadioButton
should look like this:
IsChecked="{Binding UseFix, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
Edit
For testing, I removed use of Tuple
as it's not needed, so the collection is defined as ObservableCollection<PercentageOrFixed>