mirror of
https://github.com/ckaczor/Common.Wpf.git
synced 2026-01-14 01:25:37 -05:00
Initial commit
This commit is contained in:
30
Toolbar/ImageButton.xaml.cs
Normal file
30
Toolbar/ImageButton.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user