I've got the following code that raises the MouseLeftButtonDownEvent on a DataGridCell.
DataGridCell dataGridCell = cell as DataGridCell;
MouseButtonEventArgs someEventArgs =
new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left);
someEventArgs.RoutedEvent = DataGridCell.MouseLeftButtonDownEvent;
dataGridCell.RaiseEvent(someEventArgs);
It works fine, and the cell is selected. However I am now trying to do the same thing using an AutomationPeer, but I have not been able to find a way to do the same thing.
Is it possible to do it using the AutomationPeers? If yes, how do I do it?
note: I need it to raise a MouseDownEvent, not a Click event.
Thanks