Exemple #1
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// navigationstoppedeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this NavigationStoppedEventHandler navigationstoppedeventhandler, Object sender, NavigationEventArgs e, AsyncCallback callback)
        {
            if (navigationstoppedeventhandler == null)
            {
                throw new ArgumentNullException("navigationstoppedeventhandler");
            }

            return(navigationstoppedeventhandler.BeginInvoke(sender, e, callback, null));
        }
        /// <summary>
        /// Raises the Stopped event synchronously.
        /// </summary>
        /// <param name="content">A reference to the object content that is being navigated to.</param>
        /// <param name="uri">A URI value representing the navigation content.</param>
        private void RaiseNavigationStopped(object content, Uri uri)
        {
            NavigationStoppedEventHandler eventHandler = this.NavigationStopped;

            if (eventHandler != null)
            {
                NavigationEventArgs eventArgs = new NavigationEventArgs(content, uri);
                eventHandler(this, eventArgs);
            }
        }