Popup does not closed event Stayopen set as False

Chintoo Semi

Total Post:135

Points:947

Posted by  Chintoo Semi
C# 
C#
 1270  View(s)
Ratings:
Rate this:

I have use the following code snippet to define the Popup.

XAML:

  <Grid Margin="0,0,0,0"  Height="40">      
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="19" />
      <ColumnDefinition Width="19" />
    </Grid.ColumnDefinitions>
    <TextBlock HorizontalAlignment="Stretch"
               Text="HeaderText"                        
               FontWeight="Bold"
               TextTrimming="CharacterEllipsis"
               VerticalAlignment="Center"/>
       <Grid Grid.Column="1">
         <Button Width="19" x:Name="FilterButton" Click="FilterButton_OnClick" Content="^"/>
         <Popup x:Name="FilterPanel" StaysOpen="False"   >
           <Border >
             <Grid>
               <TextBlock x:Name="tblTitle" Text="PopUp Header" Background="Red" Grid.Column="0" Grid.Row="0"/>
             </Grid>
           </Border>
         </Popup>
       </Grid>
    <TextBox Text="Test" Grid.Column="2"/>
  </Grid>

I have use the following code snippet to open the popup

C#:

private void FilterButton_OnClick(object sender, RoutedEventArgs e)
{
     this.FilterPanel.IsOpen = true;
}

Scenorio:

Open the popup using button click.

Actual Behavior:

Popup does not close.

Expected Behavior:

Popup should be closed.

Thanks in advance.

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.