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>


/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2019, Red Hat, Inc., and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this