(System.ArgumentException) Value does not fall within the expected range exception thrown while open the popup in another one popup in uwp.
Popup open from the button click. Please refer the code
<Button Width="50" Height="30" Name="btn1"
HorizontalAlignment="Center" VerticalAlignment="Center"
Content="Click" Click="Button_Click" />
<Popup Name="popUp1" Width="200" Height="200"/>
<Popup Name="popUp2" Width="200" Height="200"/>
private void Button_Click(object sender, RoutedEventArgs e)
{
Button btn2 = new Button();
btn2.Width = 200;
btn2.Height = 50;
btn2.Content = "PopUp1";
popUp1.Child = btn2;
popUp1.IsOpen = true;
btn2.Click += Btn2_Click;
}
private void Btn2_Click(object sender, RoutedEventArgs e)
{
popUp2.Child = btn1;
popUp2.IsOpen = true;
}
