Repository navigation
Expand file tree
/
Copy pathImageButton.cs
More file actions
49 lines (39 loc) · 1.86 KB
/
Copy pathImageButton.cs
File metadata and controls
49 lines (39 loc) · 1.86 KB
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
using System.Windows;
using System.Windows.Media;
#pragma warning disable CA1720 // Identifier contains type name
namespace GitHub.UI
{
public class ImageButton : DependencyObject
{
public static readonly DependencyProperty ImagePressedProperty =
DependencyProperty.Register("ImagePressed", typeof(ImageSource), typeof(ImageButton), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty ImageMouseOverProperty =
DependencyProperty.Register("ImageMouseOver", typeof(ImageSource), typeof(ImageButton), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty ImageProperty =
DependencyProperty.Register("Image", typeof(ImageSource), typeof(ImageButton), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
public static ImageSource GetImage(DependencyObject obj)
{
return (ImageSource)obj.GetValue(ImageProperty);
}
public static ImageSource GetImageMouseOver(DependencyObject obj)
{
return (ImageSource)obj.GetValue(ImageMouseOverProperty);
}
public static ImageSource GetImagePressed(DependencyObject obj)
{
return (ImageSource)obj.GetValue(ImagePressedProperty);
}
public static void SetImage(DependencyObject obj, ImageSource value)
{
obj.SetValue(ImageProperty, value);
}
public static void SetImageMouseOver(DependencyObject obj, ImageSource value)
{
obj.SetValue(ImageMouseOverProperty, value);
}
public static void SetImagePressed(DependencyObject obj, ImageSource value)
{
obj.SetValue(ImagePressedProperty, value);
}
}
}