I defined a template in ItemsControl, and there is a button in the template that supports popping up a Popup. However, because a Popup is essentially a window with an independent visual tree, it cannot find the action. I searched for a solution and found a corresponding method that I hope will be helpful to you. I have tested it and it indeed works.
https://www.cnblogs.com/gaoshang212/p/4203929.html