text: ﻿<Window x:Class="SDKSample.Window1"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="PopupCustomPlacement"
      >
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition />
          <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition />
          <RowDefinition />
          <RowDefinition />
          <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0">
          <TextBlock Foreground="Brown" TextWrapping="Wrap" FontSize="12"
                     Margin="10">
          This example shows how to position a Popup 
          when the Placement property is set to "Custom"
          and the PlacementTarget is the button.</TextBlock>
          <Button Name="myButton"  Width="200" Margin="20,20,20,20"  
                  Click="onClick">Click to display Popup</Button>
         </StackPanel>
        <!--<SnippetCustomPlacement>-->
         <Popup Name="popup1"  
                PlacementTarget ="{Binding ElementName=myButton}" 
                Placement="Custom">
          <TextBlock Height="60" Width="200" 
                     Background="LightGray"
                     TextWrapping="Wrap">Popup positioned by using
          CustomPopupPlacement callback delegate</TextBlock>
        </Popup>
        <!--</SnippetCustomPlacement>-->
      </Grid>
  </Window>
  