I want to show a window for some inputs on the click of a button. The window should be placed right below the button (green circle is the button, white is the new window):
How do I get the location of the button to set the location of the new window in MVVM?
I have the button in the view like this:
<Button Command="{Binding LoginCommand}"/>
The command in the viewmodel:
private void ExecuteLoginCommand()
{
var dialog = new UserLogin();
dialog.ShowDialog();
}
Binding the location of the button to the VM and then sending it to the new windows might be a solution, but is it a good one?