« MahApps.Metro » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
Ligne 51 : | Ligne 51 : | ||
= Installation via Nuget = | = Installation via Nuget = | ||
{| class="wikitable wtp" | {| class="wikitable wtp wtmono1" | ||
! Paquet NuGet | ! Paquet NuGet | ||
! Contenu | ! Contenu | ||
|- | |- | ||
| MahApps.Metro || MahApps.Metro | | MahApps.Metro || {{boxx|MahApps.Metro}} {{boxx|ControlzEx}} | ||
|- | |- | ||
| MahApps.Metro.Resources || Resources/Icons.xaml, Resources/IconsNonShared.xaml, Resources/Entypo.ttf | | MahApps.Metro.Resources || Resources/Icons.xaml, Resources/IconsNonShared.xaml, Resources/Entypo.ttf | ||
|} | |} |
Version du 12 avril 2021 à 19:57
Liens
Thèmes
App.xaml |
<Application> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <!-- MahApps.Metro resource dictionaries. --> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> <!-- Accent and AppTheme --> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Orange.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> |
MainWindow.xaml |
<!-- Remplacer Window par MetroWindow --> <Controls:MetroWindow xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"> |
MainWindow.xaml.cs |
// Supprimer l'héritage de Window public partial class MainWindow |
TextBox
Watermark
<Window xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"> <TextBox Controls:TextBoxHelper.Watermark="Filtre" /> |
Clear button
<Window xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"> <TextBox Controls:TextBoxHelper.ClearTextButton="True" /> |
Dialogs
// depuis une MetroWindow await this.ShowMessageAsync("Titre", "Message"); |
Installation via Nuget
Paquet NuGet | Contenu |
---|---|
MahApps.Metro | MahApps.Metro ControlzEx |
MahApps.Metro.Resources | Resources/Icons.xaml, Resources/IconsNonShared.xaml, Resources/Entypo.ttf |