WPF Viewbox 和 WebBrowser 控件

Dev*_*per 4 .net wpf xaml

有人知道为什么 WPFViewbox控件不能扩展 WPFWebBrowser控件吗?

有可能做到吗?

XAML:

<Window x:Class="WpfApplication12.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Background="Yellow">
<Viewbox Stretch="Fill"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<WebBrowser VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Source="http://stackoverflow.com"></WebBrowser>
</Viewbox>
</Window>
Run Code Online (Sandbox Code Playgroud)

Céd*_*non 5

因为它继承自 : System.Windows.Interop.HwndHost(承载 Win32 窗口)

它不是一个纯粹的 WPF 对象。

那么效果、缩放等就不能应用在它上面了。

WPF 4.5 开发者预览版支持 HwndHost 控件的缩放、旋转、倾斜,但他们似乎在最终版本中删除了此功能。