// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code using System; using System.ComponentModel; using System.Windows; using System.Windows.Automation.Peers; namespace Microsoft.Management.UI.Internal { /// /// Represents an image that can render as a vector or as a bitmap. /// [Localizability(LocalizationCategory.None)] partial class ScalableImage { // // Source dependency property // /// /// Identifies the Source dependency property. /// public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( "Source", typeof(ScalableImageSource), typeof(ScalableImage), new FrameworkPropertyMetadata( null, FrameworkPropertyMetadataOptions.AffectsRender, SourceProperty_PropertyChanged) ); /// /// Gets or sets the ScalableImageSource used to render the image. This is a dependency property. /// [Bindable(true)] [Category("Common Properties")] [Description("Gets or sets the ScalableImageSource used to render the image. This is a dependency property.")] [Localizability(LocalizationCategory.None)] public ScalableImageSource Source { get { return (ScalableImageSource) GetValue(SourceProperty); } set { SetValue(SourceProperty,value); } } static private void SourceProperty_PropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { ScalableImage obj = (ScalableImage) o; obj.OnSourceChanged( new PropertyChangedEventArgs((ScalableImageSource)e.OldValue, (ScalableImageSource)e.NewValue) ); } /// /// Occurs when Source property changes. /// public event EventHandler> SourceChanged; /// /// Called when Source property changes. /// protected virtual void OnSourceChanged(PropertyChangedEventArgs e) { OnSourceChangedImplementation(e); RaisePropertyChangedEvent(SourceChanged, e); } partial void OnSourceChangedImplementation(PropertyChangedEventArgs e); /// /// Called when a property changes. /// private void RaisePropertyChangedEvent(EventHandler> eh, PropertyChangedEventArgs e) { if (eh != null) { eh(this,e); } } // // CreateAutomationPeer // /// /// Create an instance of the AutomationPeer. /// /// /// An instance of the AutomationPeer. /// protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer() { return new ExtendedFrameworkElementAutomationPeer(owner: this, controlType: AutomationControlType.Image, isControlElement: false); } } } #endregion