I was wondering if you can pass a Frame which contains a control as a command parameter?
This is what I tried:
<Button Grid.Row="2" Content="Save" HorizontalAlignment="Left" Width="100" Command="{Binding Path=SaveOptions}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Frame}}}"></Button>
However the parameter passed to the view model is null. Can anyone sugest why this is happening?
The way I can achive this is using
ElementNameattribute. But it is really interesting, whyFindAncestormode doesn’t work.