mirror of
https://github.com/ckaczor/ChrisKaczor.Wpf.Controls.Toolbar.git
synced 2026-01-26 01:25:42 -05:00
Initial commit
This commit is contained in:
30
ImageButton/ImageButton.xaml.cs
Normal file
30
ImageButton/ImageButton.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace ChrisKaczor.Wpf.Controls.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