/// <summary>
        /// ImageSourceProperty property changed handler.
        /// </summary>
        /// <param name="d">SmoothImage that changed its ImageSource.</param>
        /// <param name="e">Event arguments.</param>
        private static void OnImageSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SmoothImage source = d as SmoothImage;
            Uri         value  = (Uri)e.NewValue;

            source.OnImageSourceChanged(value);
        }
        public override void OnApplyTemplate()
        {
            if (_image != null)
            {
                _image.FinalImageAvailable -= OnFinalImageAvailable;
            }

            base.OnApplyTemplate();

            _image = MoreVisualTreeExtensions.FindFirstChildOfType <SmoothImage>(this);
            if (_image != null)
            {
                _image.FinalImageAvailable += OnFinalImageAvailable;
            }

            UpdateMap();
        }
 /// <summary>
 /// StretchProperty property changed handler.
 /// </summary>
 /// <param name="d">SmoothImage that changed its Stretch.</param>
 /// <param name="e">Event arguments.</param>
 private static void OnStretchPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     SmoothImage source = d as SmoothImage;
     Stretch     value  = (Stretch)e.NewValue;
 }
Esempio n. 4
0
        public override void OnApplyTemplate()
        {
            if (_image != null)
            {
                _image.FinalImageAvailable -= OnFinalImageAvailable;
            }

            base.OnApplyTemplate();

            _image = MoreVisualTreeExtensions.FindFirstChildOfType<SmoothImage>(this);
            if (_image != null)
            {
                _image.FinalImageAvailable += OnFinalImageAvailable;
            }

            UpdateMap();
        }