Я хочу реализовать ICommand в отдельном классе и хочу получить доступ к кнопке отсюда:
<Grid>
<Button Command="{StaticResource Do}" >Do!</Button>
</Grid>
public class DoCommand : ICommand
{
public void Execute(object parameter)
{
**I need to access a xaml that triggered this command from here**
}
public bool CanExecute(object parameter)
{
return true;
}
public event EventHandler CanExecuteChanged;
}
Как я могу это сделать?Спасибо.