NoWar
NoWar

Reputation: 37633

WPF Browser Control gives an opacity animation issue

Why I cannot animate the opacity of the WPF Browser Control? I also tried to chanage the opacity of the upper object which is Canvas, but no success.

Is there some way to do it? Thank you!

var doubleAnimation = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(0.45)));
RootGrid.BeginAnimation(UIElement.OpacityProperty, doubleAnimation);
MainBrowser.BeginAnimation(UIElement.OpacityProperty, doubleAnimation);

 <Grid Background="Transparent"  Name="RootGrid"  >       
        <WebBrowser x:Name="MainBrowser"   />
    </Grid>

Upvotes: 0

Views: 463

Answers (1)

CodeNaked
CodeNaked

Reputation: 41393

The short answer is no that is not supported. This page explains the limitations when dealing with Interop content. But the section that applies is:

Opacity/Layered Windows/AllowTransparency

Setting Opacity on a WindowsFormsHost (setting AllowsTransparency on a Window) will not work, since HwndHost doesn't support this.

Upvotes: 1

Related Questions