title: Place popup at top right corner of a window in XAML
body: <p>I am developing an app for windows store using c#/xaml.</p>
  
  <p>Xaml:</p>
  
  <pre><code>     &lt;Popup x:Name="EditQuantityPopup"
             x:Uid="EditQuantityPopup"
             AutomationProperties.AutomationId="EditQuantityPopup"
             IsLightDismissEnabled="True"
             IsOpen="{Binding IsEditPopupOpened, Mode=TwoWay}"&gt;
          &lt;Grid x:Name="PopupPanel"
                Background="{StaticResource ApplicationPageBackgroundThemeBrush}"
                Opacity=".9"
                Height="100"
                Width="230"&gt;
  
  
              &lt;Grid x:Name="ContentPopupGrid"
                    Grid.Row="1"
                    Margin="20,0,10,15"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="Auto" /&gt;
                      &lt;ColumnDefinition Width="10"/&gt;
                      &lt;ColumnDefinition Width="Auto" /&gt;
                      &lt;!--&lt;ColumnDefinition /&gt;--&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
  
                  &lt;TextBlock Grid.Column="0"
  
  
                         Text="{Binding Text}"
                             VerticalAlignment="Center"
                         TextTrimming="WordEllipsis"
                         FontSize="15"
                         Foreground="White"&gt;&lt;/TextBlock&gt;
                  &lt;ProgressRing Grid.Column="2" IsActive="{Binding LoadingData}" Height="75" Width="75"&gt;&lt;/ProgressRing&gt;
  
              &lt;/Grid&gt;
          &lt;/Grid&gt;
      &lt;/Popup&gt;
  </code></pre>
  
  <p>Code placing popout on top of a bottom app bar:</p>
  
  <pre><code>        private void EditQuantityPopup_Opened(object sender, object e)
      {
          int margin = 10;
          int appbarHeight = 90;
          EditQuantityPopup.HorizontalOffset = margin;
          EditQuantityPopup.VerticalOffset = Window.Current.CoreWindow.Bounds.Bottom - appbarHeight - PopupPanel.Height - margin;
      }
  </code></pre>
  
  <p>How to change code that popup should be placed at top right corner of a window?</p>