我正在 WPF 中开发项目,并且在我的项目中使用弹出窗口时遇到问题。我在我的窗口中使用弹出控件,如下所示: -
<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>
现在我使用文本框和按钮在 wpf 中创建新页面,并将此页面设置为弹出框显示如下:-
popupframe.Content=new SessionObjection();
现在我想用页面按钮关闭弹出窗口。我怎样做...