I have a typical edit form (user control), with several input boxes.
I need a ListBox which must show right below the TextBox with current focus, so it needs to move dynamically.
I tried some binding, but nothing happens
<local:MyList x:Name="myList"
Canvas.Left="{Binding (FocusManager.FocusedElement).Canvas.Left,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"
Canvas.Top="{Binding (FocusManager.FocusedElement).Canvas.Bottom,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}"
/>
Use a
Popupas it gives you facility to show it where you want. ItsPlacement = Bottomwill show it exactly below thePlacementTarget.Handle
GotFocus, andLostFocusofTextBox.Handlers :