= MahApps Metro =
== NuGet Components ==
* MahApps.Metro
* MahApps.Metro.Resources
* Microsoft.Bcl.Async (support forasync/await).
**''Microsoft.Bcl.Async'' Requirements**
* Install Microsoft .NET Framework 4 KB2468871 patch (http://support.microsoft.com/kb/2468871)
* Include binding redirects for platform assemblies. Add an ''app.config'' file to the project with the following contents, replacing ''[version]'' with the referenced assembly version (for example, 1.6.8.0) of ''System.Runtime'' and ''System.Threading.Tasks'':
* See:
* [[http://blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx|Async Targeting Pack]]
* [[http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx|Using async/await without .NET Framework 4.5]]
* [[http://stackoverflow.com/questions/15440829/async-await-targeting-4-0-deployment-requirements|Async/Await targeting 4.0 deployment]]
== Basic Window ==
winMain.xaml
App
...
Flyout Panel
winMain.cs
...
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
namespace quikFIT
{
public partial class winMain : MetroWindow
{
public winMain()
{
InitializeComponent();
}
// Requires async/await support (use NuGet package Microsoft.Bcl.Async)
// NOTE: Microsoft.Bcl.Async requirements:
// * Install Microsoft .NET Framework 4 KB2468871 patch (http://support.microsoft.com/kb/2468871).
// * Include binding redirects for platform assemblies.
// Add an ''app.config'' file to the project with the contents of Issue 2 Resolution
// (http://blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx),
// replacing ''[version]'' with the referenced assembly version
// (for example, 1.6.8.0) of ''System.Runtime'' and ''System.Threading.Tasks''
private async void btnHello_Click(object sender, RoutedEventArgs e)
{
await this.ShowMessageAsync("Message", "Hello World!");
MessageBox.Show("Oh, hello to you, too!"); // this should only show after dismissing previous message
}
private void btnOpenFlyout_Click(object sender, RoutedEventArgs e)
{
flyoutTest.IsOpen = !flyoutTest.IsOpen;
}
}
}
App.xaml
== Custom Control Style ==
In case where a control's style needs to be overwritten, we need to edit ''App.xaml'':
App.xaml
...
...
...
We also need to add the actual control style. Eg: for a ''TabControl'' style, we add it in ''myApp\Styles\TabControl.xaml'':
== Controls ==
=== Button ===
=== Flyout ===
General Options
=== Tile ===
=== RightWindowCommands ===
=== ToggleSwitch ===