A Popup does not give you an obvious way to move it; you can only place it relative to the purpose of the placement. However, this gives you an additional offset in relation to the purpose of the placement and that is enough to move it anywhere.
Only markup works here, which demonstrates a draggable Popup with Thumb using Markup Programming . There is a text box with a popup that appears when the text box receives keyboard focus. The popup has text and thumb.
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:p="http://markupprogramming.codeplex.com/markup/programming" Height="300" Width="300"> <Grid> <StackPanel> <TextBox x:Name="textBox1" Width="200" Height="20"/> </StackPanel> <Popup Name="popup" PlacementTarget="{Binding ElementName=textBox1}" IsOpen="{Binding IsKeyboardFocused, ElementName=textBox1, Mode=OneWay}"> <StackPanel Orientation="Horizontal"> <TextBlock Background="White" Text="Sample Popup content."/> <Thumb Name="thumb" Width="20" Height="20"/> </StackPanel> <p:Attached.Operations> <p:ScriptHandler Path="@FindElement('thumb').DragDelta"> @AssociatedObject.HorizontalOffset += @EventArgs.HorizontalChange; @AssociatedObject.VerticalOffset += @EventArgs.VerticalChange; </p:ScriptHandler> </p:Attached.Operations> </Popup> </Grid> </Window>
source share