0

I have a popup and a textbox inside UserControl.I want to create drop down popup at bottom of textbox.

There is my UserControl:

enter image description here

You can see the Popup don't move when moving the window.
UseControl.xaml:

<TextBox x:Name="txt"
    Text="{Binding CurrentVal}"
    VerticalContentAlignment="Center"
    HorizontalContentAlignment="Center"
    Width="72"
    MaxLength="9"/>
<Popup StaysOpen="{Binding ElementName=txt,Path=IsKeyboardFocused}"
    Placement="Bottom"
    PlacementTarget="{Binding ElementName=txt}">
    <Border Background="LightYellow" BorderThickness="1">
     <ItemsControl Height="200" Width="200"
      ItemsSource="{Binding Time}">
      <ItemsControl.ItemTemplate>
      <DataTemplate>
      <Grid>
      <TextBlock Text="{Binding}" Width="120"/>
      </Grid>
      </DataTemplate>
     </ItemsControl.ItemTemplate>
     </ItemsControl>
    </Border>
</Popup> 
Jandy
  • 349
  • 1
  • 6
  • 18

0 Answers0