I'm trying to create a popup with Windows Phone Toolkit DatePicker & TimePicker, with the following XAML:
<Popup x:Name="MyPopup">
<Border BorderThickness="2" Margin="10" BorderBrush="{StaticResource PhoneAccentBrush}">
<StackPanel>
<toolkit:DatePicker Name="datePicker" />
<toolkit:TimePicker Name="timePicker"/>
</StackPanel>
</Border>
</Popup>
This works, but every time I click either of them, they are rendered under the popup, e.g.
I can't figure out any way to hide the Popup while displaying the DatePicker or TimePicker.
I've tried setting the Z-Index of the controls to be greater than the Popup, as follows:
void timePicker_GotFocus(object sender, RoutedEventArgs e)
{
Canvas.SetZIndex(timePicker, Canvas.GetZIndex(MyPopup) + 1);
}
I've also tried hiding the Popup with
void timePicker_GotFocus(object sender, RoutedEventArgs e)
{
Popup.IsOpen = false;
}
but this closes the popup and the TimePicker/DatePicker.
Is there any way to view the DatePicker/TimePicker controls on top of the Popup control?