mirror of
https://github.com/ckaczor/Common.Wpf.git
synced 2026-01-14 01:25:37 -05:00
31 lines
692 B
C#
31 lines
692 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Media;
|
|
|
|
namespace Common.Wpf.Toolbar
|
|
{
|
|
public partial class ImageButton
|
|
{
|
|
public ImageButton()
|
|
{
|
|
InitializeComponent();
|
|
|
|
Loaded += HandleImageButtonLoaded;
|
|
}
|
|
|
|
void HandleImageButtonLoaded(object sender, RoutedEventArgs e)
|
|
{
|
|
if (Style == null && Parent is ToolBar)
|
|
{
|
|
Style = (Style) FindResource(ToolBar.ButtonStyleKey);
|
|
}
|
|
}
|
|
|
|
public ImageSource ImageSource
|
|
{
|
|
get { return image.Source; }
|
|
set { image.Source = value; }
|
|
}
|
|
}
|
|
}
|