MahApps/MahApps.Metro — pull request #1252 by kiangtengl (2014-04-02 12:34:21+00:00)
Title: Added support for MetroIconButton

### MetroIconButton

![iconbuttons](https://cloud.githubusercontent.com/assets/574734/2590625/da17a9c4-ba5f-11e3-9e6a-11ac6a962bf4.png)

### Usage

```xml

```

Has support for all the icons packaged with [MahApps.Metro.Resources](http://www.nuget.org/packages/MahApps.Metro.Resources).

### Structure of Control

`MetroIconButton` uses a `ContentPresenter` placed at the left of the button's default `ContentPresenter` to display the icons.

```xml

```

### Customization

The control comes with a few DependencyProperties for users to customize the position of the icon's `ContentPresenter`. This is necessary as icons are sometimes too large or do not align correctly. Listed below are the DependencyProperties that come built in with the `MetroIconButton`.

+ `Icon`: This property is bound to the `Content` property of a `ContentPresenter`. You can either use the icons packaged with `MahApps.Metro.Resources` (`{Dynamicresource appbar_alien}`) or set it to any FrameworkElement of your choice.
+ `IconRenderTransform`: Bound to the `RenderTransform` property of the `ContentPresenter`. Used this to adjust the size of the icon.
+ `IconWidth`: Bound to the `Width` property of the ContentPresenter. Use this to adjust the icon's container space.
+ `IconHeight`: Bound to the `Height` property of the ContentPresenter. Use this to adjust the icon's container space.
+ `IconMargin`: Bound to the `Margin` property of the ContentPresenter. Use this to adjust the icon's position relative to the button's text

> Note, the `ContentPresenter` mentioned in the documentation above refers to the `ContentPresenter` responsible for displaying the image