I want to refer to another element, which resides as nested under a custom user control:
<userControls:Test>
<TextBox Name="Foo" />
<Button CommandParameter="{Binding Text, ElementName=Foo" Command="{Binding anything}" />
</userControls:Test>
Basically I'm using commands and I'm trying to refer to another element with a name, but I get this famous:
Cannot set Name attribute value '...' on element '...'. '...' is under the scope of element '...', which already had a name registered when it was defined in another scope.
I figured it's impossible to name an element: How to create a WPF UserControl with NAMED content
So is there any other way to refer to the element that would work inside nested custom user control content?