/// <summary>
        /// Invoked when Source property is changed.
        /// </summary>
        private static void OnSourceChanged(DependencyObject element, DependencyPropertyChangedEventArgs e)
        {
            WebFigureViewerWindow window = element as WebFigureViewerWindow;

            if (window != null)
            {
                window.webContentHost.Navigate(null);
                window.Dispatcher.BeginInvoke(DispatcherPriority.Input, new DispatcherOperationCallback(window.InvalidateSource), null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Opens the web figure viewer window control
        /// </summary>
        /// <param name="imageReference"></param>
        /// <param name="story"></param>
        private void OpenWebFigureViewerWindow(Uri source, Story story)
        {
            // If there is no instance of image viewer currently open, create one
            if (_webFigureViewerWindow == null)
            {
                _webFigureViewerWindow         = new WebFigureViewerWindow();
                _webFigureViewerWindow.Owner   = Application.Current.MainWindow;
                _webFigureViewerWindow.Closed += OnWebFigureViewerWindowClosed;
            }

            // Configure window to control's Story and ImageReference
            _webFigureViewerWindow.Source = source;
            _webFigureViewerWindow.Story  = story;
            _webFigureViewerWindow.Show();
        }