Search code examples
wpfpopupactualwidthwpf-positioning

How to obtain the ActualWidth of a WPF Popup


I am trying to place a Popup element in a specific position, relative to the Placement control.

In order to achieve that I need to find out the ActualWidth of the popup control. But trying to get this value before or after displaying the popup (IsOpen = True) it always returns 0.

Unfortunately I cannot hard code the size of the popup.

How can I determine the ActualWidth?


Solution

  • Have you tried getting the ActualWidth of the popup's child element?