コード例 #1
0
        /// <summary>
        /// Puts an ImagePreview in the normal or disabled state.
        /// </summary>
        /// <param name="obj">The dependency object.</param>
        /// <param name="e">The event information.</param>
        private static void IsFrozen_Changed(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ImagePreview imagePreview = obj as ImagePreview;

            if (null != imagePreview)
            {
                imagePreview.UpdateState();
            }
        }
コード例 #2
0
        /// <summary>
        /// TODO
        /// </summary>
        /// <param name="d"></param>
        /// <param name="dpcea"></param>
        private static void OnSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs dpcea)
        {
            ImagePreview container = (ImagePreview)d;
            Image        contained = (Image)container.Image;
            ImageSource  source    = (ImageSource)dpcea.NewValue;

            if (null != contained)
            {
                contained.Source = container._source = source;
                container.Image_Opened(contained, null);
            }
            else
            {
                container._source = source;
            }
        }