Powershell GUI : Add MahApps Metro Theme with Powershell
https://www.systanddeploy.com/2016/01/powershell-gui-add-mahapps-metro-theme.html
In a previous post I have shown you how to add the Elysium theme to your GUI.
In this post I will show you how to add MahApps Metro Theme to your Powershell GUI.
I usually use Elysium theme but a colleague has shown me this theme, and I found it just awesome.
I created a very simple GUI to show you some possibilities that you can use with MahApps and use control with Powershell.
MahApps is very pretty and there are many possibilities.
Moreover it's very well documented.
How it looks ?
You can configure the TitleBar to add button, icons ...
You can find below in my testing tool some buttons and TabControl.
Overview of some buttons using MahApps |
One of the control I like with MahApps is the Flyout control.
In my example you can use it by clicking on the below button.
Expand button |
See the result below :
Overview of the Flyout control using MahApps |
How to use it ?
1 / Add Mahapps on Visual Studio
Type "Install-Package MahApps.Metro"
2 / Add Mahapps to your XAML
Replace <Window with <Controls:MetroWindow
Replace the last line </Windows> with</Controls:MetroWindow>
Add the below line to your XAML
To use MahaApps you have to add below lines in your PS1 script.
4 / Add an icon
Replace the last line </Windows> with</Controls:MetroWindow>
Add the below line to your XAML
3 / Add Mahapps to your PS1
To use MahaApps you have to add below lines in your PS1 script.
4 / Add an icon
With MahApps you can add easylly icons to your controls, as MetroCircleButton.
All icons are integrated in MaHapps.
You can see them on this link.
All icons are integrated in MaHapps.
You can see them on this link.
For an example if you want to integrate an icon to your button :
- Choose your icon on the website
- Click on the icon to check the name
- In your XAML add it and replace "." with "_"
Icons for MahApps |
6 / Add a Flyout control
Add the below part in your XAML
Add a button to display your flyout
Add the below part to your PS1 to add an action to your button
How to see more ?
This theme has been created by Paul Jenkins, and is maintained by Brendan Forster, Dennis Daume, Alex Mitchell and Jan Karger.You can see Here, how to use some controls which are more often used as :
- Buttons
- DataGrid
- Dialogs
- Flyouts
- ProgressBar
- ProgressRing
- TextBox
- TabControl
- and more ...
You can find Here, some guides to use MahApps.
1 commentaire
Bonjour,
Vous publiez beaucoup mais vos codes ne fonctionnent pas toujours et votre site contient des erreurs 404.
Vos interfaces sont propres du moins de ce qui est présenté, mais vous n'etes pas très clair dans vos énoncés ce qui fait que le débogage est quasi impossible.
Cdt,
M.Picart
Enregistrer un commentaire