I am developing project in WPF and I am facing a problem using a popup window in my project. I use popup control in my window as shown below:-
<Popup HorizontalAlignment="Center" VerticalAlignment="Center"
AllowsTransparency="True" x:Name="popup" Placement="Center"
OpacityMask="#FFC86E6E" Closed="popup_Closed" >
<Grid Height="auto" Width="auto" Margin="0" >
<Grid.RowDefinitions>
<RowDefinition Height="0.488*"/>
<RowDefinition Height="0.512*"/>
</Grid.RowDefinitions>
<Frame x:Name="popupframe" Margin="0" Grid.Row="1" />
<Button Width="30" Height="30" HorizontalAlignment="Right"
Margin="0,0,10,-50" VerticalAlignment="Center"
BorderThickness="0" BorderBrush="{x:Null}"
ClickMode="Press" Click="Button_Click"
Foreground="{x:Null}">
<Button.Background>
<ImageBrush ImageSource="Image/1329666144_button_cancel.png" Stretch="UniformToFill"/>
</Button.Background>
</Button>
</Grid>
</Popup>
Now i Create new page in wpf with textbox and button and set this page to popup frame show below:-
popupframe.Content=new SessionObjection();
Now i want to close popup window with page button. How i do...
You could set StaysOpen="False", and " IsOpen="False"" in C# code to close your Popup. Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Pressing ALT + F4 . Pressing the Close button.
GetType(), "onclick", "window. close()", true);
You can close the popup by setting the IsOpen property to false
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With