2021-04-29 05:05:55 -07:00
|
|
|
using System.Windows;
|
|
|
|
using System.Windows.Controls;
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
|
|
namespace SourceGit.Views.Controls {
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 简化只有一个Icon的Button
|
|
|
|
/// </summary>
|
|
|
|
public class IconButton : Button {
|
|
|
|
|
|
|
|
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
|
2021-08-05 00:54:00 -07:00
|
|
|
"Icon",
|
|
|
|
typeof(Geometry),
|
|
|
|
typeof(IconButton),
|
2021-04-29 05:05:55 -07:00
|
|
|
new PropertyMetadata(null));
|
|
|
|
|
|
|
|
public Geometry Icon {
|
|
|
|
get { return (Geometry)GetValue(IconProperty); }
|
|
|
|
set { SetValue(IconProperty, value); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public static readonly DependencyProperty HoverBackgroundProperty = DependencyProperty.Register(
|
2021-08-05 00:54:00 -07:00
|
|
|
"HoverBackground",
|
|
|
|
typeof(Brush),
|
|
|
|
typeof(IconButton),
|
2021-04-29 05:05:55 -07:00
|
|
|
new PropertyMetadata(Brushes.Transparent));
|
|
|
|
|
|
|
|
public Brush HoverBackground {
|
|
|
|
get { return (Brush)GetValue(HoverBackgroundProperty); }
|
|
|
|
set { SetValue(HoverBackgroundProperty, value); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|