Replies: 1 comment
-
Anchestor is always a control and cannot be a ViewModel, so this is why your proposal will not work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
the project use this way
<Button Command="{Binding #Root.((vm:MainWindowViewModel)DataContext).RemoveItemCommand}"
Is there another way?
I use this, but it does not work.😅 Can anyone tell me why?
<Button Command="{Binding Path=RemoveItemCommand, RelativeSource={RelativeSource AncestorType=vm:MainWindowViewModel}}"
Beta Was this translation helpful? Give feedback.
All reactions