File size: 3,360 Bytes
8c763fb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | // 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
{
/// <summary>
/// Represents an image that can render as a vector or as a bitmap.
/// </summary>
[Localizability(LocalizationCategory.None)]
partial class ScalableImage
{
//
// Source dependency property
//
/// <summary>
/// Identifies the Source dependency property.
/// </summary>
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( "Source", typeof(ScalableImageSource), typeof(ScalableImage), new FrameworkPropertyMetadata( null, FrameworkPropertyMetadataOptions.AffectsRender, SourceProperty_PropertyChanged) );
/// <summary>
/// Gets or sets the ScalableImageSource used to render the image. This is a dependency property.
/// </summary>
[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>((ScalableImageSource)e.OldValue, (ScalableImageSource)e.NewValue) );
}
/// <summary>
/// Occurs when Source property changes.
/// </summary>
public event EventHandler<PropertyChangedEventArgs<ScalableImageSource>> SourceChanged;
/// <summary>
/// Called when Source property changes.
/// </summary>
protected virtual void OnSourceChanged(PropertyChangedEventArgs<ScalableImageSource> e)
{
OnSourceChangedImplementation(e);
RaisePropertyChangedEvent(SourceChanged, e);
}
partial void OnSourceChangedImplementation(PropertyChangedEventArgs<ScalableImageSource> e);
/// <summary>
/// Called when a property changes.
/// </summary>
private void RaisePropertyChangedEvent<T>(EventHandler<PropertyChangedEventArgs<T>> eh, PropertyChangedEventArgs<T> e)
{
if (eh != null)
{
eh(this,e);
}
}
//
// CreateAutomationPeer
//
/// <summary>
/// Create an instance of the AutomationPeer.
/// </summary>
/// <returns>
/// An instance of the AutomationPeer.
/// </returns>
protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer()
{
return new ExtendedFrameworkElementAutomationPeer(owner: this, controlType: AutomationControlType.Image, isControlElement: false);
}
}
}
#endregion
|