c# - 如何在 WPF 中创建忽略鼠标事件的覆盖弹出窗口?
问题描述
如何在 webview 控件之上创建一个半透明的弹出窗口,以便弹出窗口不会拦截鼠标事件?我希望鼠标与底层的 webview 控件内容进行交互,而不是弹出窗口。这可能吗?
下面是我的 xaml 片段:
<Grid Name="windowGrid" Background="#FFDE0707">
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Controls:WebView Grid.Row="0" Grid.Column="0" Name="wvc" Width="800" Height="800" HorizontalAlignment="Left" VerticalAlignment="Top" Source="http://www.google.ca" />
<Popup PlacementTarget="{Binding ElementName=wvc}" Placement="Center" IsOpen="true" AllowsTransparency="True">
<Rectangle Height="400" Width="400" Fill="Purple" Opacity="0.25" IsHitTestVisible="False" />
</Popup>
</Grid>
</StackPanel>
</Grid>
解决方案
推荐阅读
- python - python 从另一个文件夹的文件中导入类
- node.js - NodeJS + Socket.io:无法将数据发送到客户端创建的特定房间
- javascript - 我们如何在 React Native 中制作可选的 touchableOpectiy 或视图
- python - 查找列表列表的两个“列”的最小值
- android - Android -> 致命异常:android.database.sqlite.SQLiteDatabaseLockedException 数据库被锁定(代码 5)
- php - Laravel 社交名流未定义类型
- sql - 取最近 7 天的平均值;但考虑到可用天数
- css - 订购 flexbox 元素使容器无法填满屏幕
- c# - WPF DataGrid 中的空行
- c++ - C++ 可变参数模板空参数特化