All you need to do is to add both watched and clicked element to repository (using Track button). Then you just need to reference their info object in provided popupwatcher method like this...
// Add a Watch using the info object of the dialog and the info object of the button to click
Where the "Info" object is a special kind of object for accessing the repository elements, preventing Ranorex from throwing an exception. Info object should be available for each repository element or folder. When you start typing in code (starting with repo.
) you should get the info objects in the list of available code-completion
items (methods, parameters, etc, including available repo elements). If you don't see the info object (in the code-completion list) use selfinfo instead.
Hope this helps? In case yous still need some more help, I can post you a simple sample project tomorrow.