Note that there are some explanatory texts on larger screens.

plurals
  1. PODisply a Dialog box for user input in a Win 8 Store XAML app
    primarykey
    data
    text
    <p>Is there a way to achieve the Dialog like effect in a Win 8 Store XAML app; similar to the one indicated <a href="https://stackoverflow.com/questions/11593978/in-winrt-api-how-to-accept-user-input-in-a-dialog-just-like-in-weather-and-fina">in this post</a> where the content of the dialog is a custom control to gather user input.</p> <p>Here is some sample XAML content that I would like to display centered similar to the one indicated in the post above.</p> <pre class="lang-xml prettyprint-override"><code>&lt;common:LayoutAwarePage x:Class="App1.UserControls.Control1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" &gt; &lt;Grid HorizontalAlignment="Stretch" Background="Gold" VerticalAlignment="Center"&gt; &lt;StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" AreScrollSnapPointsRegular="True" Margin="20"&gt; &lt;TextBlock Text="This is sample text" FontSize="20" Style="{StaticResource HeaderTextStyle}"/&gt; &lt;Button Content="Close" Click="btnClose_Click" Margin="0,20,0,0" HorizontalAlignment="Right"/&gt; &lt;/StackPanel&gt; &lt;/Grid&gt;&lt;/common:LayoutAwarePage&gt; </code></pre> <p>I am using the Popup control to display this from a Main page like so:</p> <pre class="lang-xml prettyprint-override"><code>&lt;common:LayoutAwarepage&gt; &lt;Grid Style="{StaticResource LayoutRootStyle}"&gt; &lt;Popup x:Name="ParentedPopup" VerticalOffset="300" HorizontalOffset="200" HorizontalAlignment="Stretch"&gt; &lt;usercontrols:CreateCategory/&gt; &lt;/Popup&gt; &lt;/Grid&gt; &lt;Page.BottomAppBar&gt; &lt;AppBar x:Name="bottomAppBar" Padding="10,0,10,0"&gt; &lt;Grid&gt; &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Left"&gt; &lt;Button Style="{StaticResource AddAppBarButtonStyle}" Click="AddButton_Click"/&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; &lt;/AppBar&gt; &lt;/Page.BottomAppBar&gt;&lt;/common:LayoutAwarePage&gt; </code></pre> <pre class="lang-cs prettyprint-override"><code>private void AddButton_Click(object sender, RoutedEventArgs e) { if (!ParentedPopup.IsOpen) { ParentedPopup.IsOpen = true; } } </code></pre> <p>However, this is not displaying as I intend it to, the popup does not show the xaml content centered, it shows up at the top and is not centered and stretched as I would like.</p> <p>Is there a simple way to achieve this? Note: I do not want to take dependencies on any libraries.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload