« MahApps.Metro » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
 
 
(11 versions intermédiaires par le même utilisateur non affichées)
Ligne 2 : Ligne 2 :
= Liens =
= Liens =
* [http://mahapps.com/guides/quick-start.html Quick Start]
* [http://mahapps.com/guides/quick-start.html Quick Start]
* [http://mahapps.com/controls/ Controls]
* [https://github.com/MahApps/MahApps.Metro Github repo]


= [http://mahapps.com/guides/styles.html Thèmes] =
= [https://mahapps.com/docs/themes/usage Build-in styles and themes] =
<filebox fn='App.xaml' lang='xaml'>
<filebox fn='App.xaml' lang='xaml'>
<Application>
<Application>
Ligne 10 : Ligne 10 :
         <ResourceDictionary>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
             <ResourceDictionary.MergedDictionaries>
                 <!-- MahApps.Metro resource dictionaries. -->
                 <!-- MahApps.Metro resource dictionaries -->
                 <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                 <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/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
                 <!-- Accent and AppTheme -->
                 <!-- Accent and AppTheme -->
                 <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Orange.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/dark.blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
             </ResourceDictionary.MergedDictionaries>
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
         </ResourceDictionary>
Ligne 22 : Ligne 20 :
</Application>
</Application>
</filebox>
</filebox>
<filebox fn='MainWindow.xaml' lang='xaml'>
<filebox fn='MainWindow.xaml' lang='xaml'>
<!-- Remplacer Window par MetroWindow -->
<!-- Remplacer Window par MetroWindow -->
<Controls:MetroWindow xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls">
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls">
</filebox>
</filebox>
<filebox fn='MainWindow.xaml.cs' lang='csharp'>
<filebox fn='MainWindow.xaml.cs' lang='csharp'>
// Supprimer l'héritage de Window
// Supprimer l'héritage de Window
public partial class MainWindow
public partial class MainWindow
</filebox>
</filebox>
= [https://mahapps.com/docs/controls Controls] =
== [https://mahapps.com/docs/controls/metrowindow MetroWindow] ==
<kode lang='xaml'>
<!-- Normal Border -->
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
                BorderBrush="{DynamicResource MahApps.Brushes.Accent}"
                BorderThickness="1">
<!-- Glow Border -->
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
                GlowBrush="{DynamicResource MahApps.Brushes.Accent}">
</kode>


= [http://mahapps.com/controls/textbox.html TextBox] =
= [http://mahapps.com/controls/textbox.html TextBox] =
Ligne 50 : Ligne 63 :
</kode>
</kode>


= Installation via Nuget =
= [https://mahapps.com/docs/guides/quick-start Installation via Nuget] =
{| class="wikitable wtp"  
{| class="wikitable wtp wtmono1"  
! Paquet NuGet
! Paquet NuGet
! Contenu
! Contenu
|-
|-
| MahApps.Metro || MahApps.Metro.dll
| MahApps.Metro || {{boxx|MahApps.Metro}} {{boxx|ControlzEx}}
|-
|-
| MahApps.Metro.Resources || Resources/Icons.xaml, Resources/IconsNonShared.xaml, Resources/Entypo.ttf
| [https://github.com/MahApps/MahApps.Metro.IconPacks MahApps.Metro.IconPacks] || {{boxx|MahApps.Metro.IconPacks}}
|}
|}

Dernière version du 22 octobre 2021 à 09:49

Liens

Build-in styles and themes

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" />
                <!-- Accent and AppTheme -->
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/dark.blue.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
MainWindow.xaml
<!-- Remplacer Window par MetroWindow -->
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls">
MainWindow.xaml.cs
// Supprimer l'héritage de Window
public partial class MainWindow

Controls

MetroWindow

Xaml.svg
<!-- Normal Border -->
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
                 BorderBrush="{DynamicResource MahApps.Brushes.Accent}"
                 BorderThickness="1">

<!-- Glow Border -->
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
                 GlowBrush="{DynamicResource MahApps.Brushes.Accent}">

TextBox

Watermark

Xaml.svg
<Window xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls">
    <TextBox Controls:TextBoxHelper.Watermark="Filtre" />

Clear button

Xaml.svg
<Window xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls">
    <TextBox Controls:TextBoxHelper.ClearTextButton="True" />

Dialogs

Csharp.svg
// depuis une MetroWindow
await this.ShowMessageAsync("Titre", "Message");

Installation via Nuget

Paquet NuGet Contenu
MahApps.Metro MahApps.Metro ControlzEx
MahApps.Metro.IconPacks MahApps.Metro.IconPacks