打开我的弹出窗口时,第一次单击“最小化”或“最大化”或“关闭”按钮不起作用。第一次单击这些标题栏按钮将关闭弹出菜单并移动焦点,然后在第二次单击上最小化/最大化/关闭窗口工作。有什么办法-我们可以在第一次单击时激活这些标题栏按钮吗?MainWindow.xaml<Button Height="54" Width="50" Margin="100,0,0,0" x:Name="btnNotification" FontFamily="Segoe UI Symbol" FontSize="20" Content="🔔" Command="{Binding LoadNotification}" Click="btnNotification_Click"/><Popup Name="NotificationPopup" IsOpen="False" Closed="PopupClosed" StaysOpen="False" PlacementTarget="{Binding ElementName=btnNotification}" Placement="Bottom" VerticalOffset="20"> <Grid x:Name="PopUpGrid" Height="560" Width="360" Background="White"> <StackPanel Orientation="Vertical" HorizontalAlignment="Right"> <Button BorderBrush="Transparent" BorderThickness="0" Background="White" > <StackPanel Width="{Binding ActualWidth, ElementName=PopUpGrid}" Orientation="Vertical"> <WrapPanel> <Rectangle Width="20"/> <TextBlock Text="Notifications" Width="300" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="24" FontWeight="Light" /> <Button Click="btnNotification_Click" > <StackPanel> <TextBlock Text="✕" Foreground="Black" FontWeight="ExtraLight"/> </StackPanel> </Button> </WrapPanel> <Grid> <!--Datagrid--> </Grid> </StackPanel> </Button> </StackPanel> </Grid></Popup>MainWindow.xaml.cspublic void PopupClosed(object sender, EventArgs e){ NotificationPopup.IsOpen = false; }
1 回答
- 1 回答
- 0 关注
- 156 浏览
添加回答
举报
0/150
提交
取消