|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Text; |
| 5 | +using System.Threading.Tasks; |
| 6 | +using System.Windows; |
| 7 | +using System.Windows.Controls; |
| 8 | +using System.Windows.Media; |
| 9 | +using System.Windows.Media.Imaging; |
| 10 | + |
| 11 | +namespace EmptyKeys.UserInterface.Designer |
| 12 | +{ |
| 13 | + /// <summary> |
| 14 | + /// Implements button with image |
| 15 | + /// </summary> |
| 16 | + public class ImageButton : Button |
| 17 | + { |
| 18 | + private static readonly Type typeOfThis = typeof(ImageButton); |
| 19 | + private static DependencyObjectType dependencyType; |
| 20 | + |
| 21 | + /// <summary> |
| 22 | + /// The image normal property |
| 23 | + /// </summary> |
| 24 | + public static readonly DependencyProperty ImageNormalProperty = |
| 25 | + DependencyProperty.Register("ImageNormal", typeof(BitmapImage), typeOfThis, |
| 26 | + new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure)); |
| 27 | + |
| 28 | + /// <summary> |
| 29 | + /// Gets or sets the image normal. |
| 30 | + /// </summary> |
| 31 | + /// <value> |
| 32 | + /// The image normal. |
| 33 | + /// </value> |
| 34 | + public BitmapImage ImageNormal |
| 35 | + { |
| 36 | + get { return (BitmapImage)GetValue(ImageNormalProperty); } |
| 37 | + set { SetValue(ImageNormalProperty, value); } |
| 38 | + } |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// The image pressed property |
| 42 | + /// </summary> |
| 43 | + public static readonly DependencyProperty ImagePressedProperty = |
| 44 | + DependencyProperty.Register("ImagePressed", typeof(BitmapImage), typeOfThis, |
| 45 | + new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure)); |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Gets or sets the image pressed. |
| 49 | + /// </summary> |
| 50 | + /// <value> |
| 51 | + /// The image pressed. |
| 52 | + /// </value> |
| 53 | + public BitmapImage ImagePressed |
| 54 | + { |
| 55 | + get { return (BitmapImage)GetValue(ImagePressedProperty); } |
| 56 | + set { SetValue(ImagePressedProperty, value); } |
| 57 | + } |
| 58 | + |
| 59 | + /// <summary> |
| 60 | + /// The image hover property |
| 61 | + /// </summary> |
| 62 | + public static readonly DependencyProperty ImageHoverProperty = |
| 63 | + DependencyProperty.Register("ImageHover", typeof(BitmapImage), typeOfThis, |
| 64 | + new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure)); |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// Gets or sets the image hover. |
| 68 | + /// </summary> |
| 69 | + /// <value> |
| 70 | + /// The image hover. |
| 71 | + /// </value> |
| 72 | + public BitmapImage ImageHover |
| 73 | + { |
| 74 | + get { return (BitmapImage)GetValue(ImageHoverProperty); } |
| 75 | + set { SetValue(ImageHoverProperty, value); } |
| 76 | + } |
| 77 | + |
| 78 | + /// <summary> |
| 79 | + /// The image disabled property |
| 80 | + /// </summary> |
| 81 | + public static readonly DependencyProperty ImageDisabledProperty = |
| 82 | + DependencyProperty.Register("ImageDisabled", typeof(BitmapImage), typeOfThis, |
| 83 | + new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure)); |
| 84 | + |
| 85 | + /// <summary> |
| 86 | + /// Gets or sets the image disabled. |
| 87 | + /// </summary> |
| 88 | + /// <value> |
| 89 | + /// The image disabled. |
| 90 | + /// </value> |
| 91 | + public BitmapImage ImageDisabled |
| 92 | + { |
| 93 | + get { return (BitmapImage)GetValue(ImageDisabledProperty); } |
| 94 | + set { SetValue(ImageDisabledProperty, value); } |
| 95 | + } |
| 96 | + |
| 97 | + /* |
| 98 | + /// <summary> |
| 99 | + /// The image focused property |
| 100 | + /// </summary> |
| 101 | + public static readonly DependencyProperty ImageFocusedProperty = |
| 102 | + DependencyProperty.Register("ImageFocused", typeof(BitmapImage), typeOfThis, |
| 103 | + new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure)); |
| 104 | +
|
| 105 | + /// <summary> |
| 106 | + /// Gets or sets the image focused. |
| 107 | + /// </summary> |
| 108 | + /// <value> |
| 109 | + /// The image focused. |
| 110 | + /// </value> |
| 111 | + public BitmapImage ImageFocused |
| 112 | + { |
| 113 | + get { return (BitmapImage)GetValue(ImageFocusedProperty); } |
| 114 | + set { SetValue(ImageFocusedProperty, value); } |
| 115 | + } |
| 116 | + */ |
| 117 | + |
| 118 | + /// <summary> |
| 119 | + /// The image stretch property |
| 120 | + /// </summary> |
| 121 | + public static readonly DependencyProperty ImageStretchProperty = |
| 122 | + DependencyProperty.Register("ImageStretch", typeof(Stretch), typeOfThis, |
| 123 | + new FrameworkPropertyMetadata(Stretch.Uniform, FrameworkPropertyMetadataOptions.AffectsMeasure)); |
| 124 | + |
| 125 | + /// <summary> |
| 126 | + /// Gets or sets the image stretch. |
| 127 | + /// </summary> |
| 128 | + /// <value> |
| 129 | + /// The image stretch. |
| 130 | + /// </value> |
| 131 | + public Stretch ImageStretch |
| 132 | + { |
| 133 | + get { return (Stretch)GetValue(ImageStretchProperty); } |
| 134 | + set { SetValue(ImageStretchProperty, value); } |
| 135 | + } |
| 136 | + |
| 137 | + /// <summary> |
| 138 | + /// Initializes the <see cref="ImageButton"/> class. |
| 139 | + /// </summary> |
| 140 | + static ImageButton() |
| 141 | + { |
| 142 | + } |
| 143 | + |
| 144 | + /// <summary> |
| 145 | + /// Initializes a new instance of the <see cref="ImageButton"/> class. |
| 146 | + /// </summary> |
| 147 | + public ImageButton() |
| 148 | + : base() |
| 149 | + { |
| 150 | + } |
| 151 | + } |
| 152 | +} |
0 commit comments