Ahmed Ghoneim
Ahmed Ghoneim

Reputation: 7067

WPF Triggers WebBrowser Navigating/Navigated

My Question :
How can i trigger webbrowser events like navigating/navigated so that i can animate the whole browser ?

I can't find those 2 actions in Triggers panel in Blend 4

Upvotes: 0

Views: 965

Answers (1)

brunnerh
brunnerh

Reputation: 185578

EventTriggers only work with RoutedEvents, those events are not routed.

You can handle those events and animate in code.


Apart from that you can use Blend's Interactivity:

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
<WebBrowser>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Navigated">
            <i:EventTrigger.Actions>
                <ei:ControlStoryboardAction>
                    <ei:ControlStoryboardAction.Storyboard>
                        <!-- Storyboard here -->
                    </ei:ControlStoryboardAction.Storyboard>
                </ei:ControlStoryboardAction>
            </i:EventTrigger.Actions>
        </i:EventTrigger>
    </i:Interaction.Triggers>
</WebBrowser>

I am surprised that their use is not integrated into Blend's trigger editing UI.

Upvotes: 1

Related Questions