본문 바로가기

개발자/WPF(C#) UI

Mahapps - IconPacks

반응형

https://www.youtube.com/watch?v=D49z8m4DelQ

Mahapps - IconPacks Tutorial

 

깃허브 주소 : https://github.com/MahApps/MahApps.Metro.IconPacks/wiki

 

MahApps/MahApps.Metro.IconPacks

Awesome icon packs for WPF and UWP in one library. Contribute to MahApps/MahApps.Metro.IconPacks development by creating an account on GitHub.

github.com

Install, Usage 

 

xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"

 

Namespace

The Xaml namespace for all is:

xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"

and for the UWP:

xmlns:iconPacks="using:MahApps.Metro.IconPacks"

PackIcon controls

The PackIcon controls are the main featured controls to use an icon in a simple way.

<StackPanel Orientation="Horizontal"> <iconPacks:PackIconBoxIcons Kind="LogosApple" /> <iconPacks:PackIconEntypo Kind="Adjust" /> <iconPacks:PackIconEvaIcons Kind="AlertTriangleOutline" /> <iconPacks:PackIconFeatherIcons Kind="AlertTriangle" /> <iconPacks:PackIconFontAwesome Kind="AddressBookRegular" /> <iconPacks:PackIconIonicons Kind="AnalyticsiOS" /> <iconPacks:PackIconJamIcons Kind="Anchor" /> <iconPacks:PackIconMaterial Kind="AccessPoint" /> <iconPacks:PackIconMaterialDesign Kind="AccessAlarm" /> <iconPacks:PackIconMaterialLight Kind="Alarm" /> <iconPacks:PackIconMicrons Kind="Audio" /> <iconPacks:PackIconModern Kind="Alert" /> <iconPacks:PackIconOcticons Kind="Archive" /> <iconPacks:PackIconPicolIcons Kind="Accept" /> <iconPacks:PackIconRPGAwesome Kind="AlienFire" /> <iconPacks:PackIconSimpleIcons Kind="AdobeCreativeCloud" /> <iconPacks:PackIconTypicons Kind="Anchor" /> <iconPacks:PackIconUnicons Kind="AccessibleIconAlt" /> <iconPacks:PackIconWeatherIcons Kind="DayCloudy" /> <iconPacks:PackIconZondicons Kind="Anchor" /> </StackPanel>

PackIconControl (WPF only)

There is also a common PackIconControl for all IconPacks available (WPF only). This control is only available with the MahApps.Metro.IconPacks NuGet package.

So you can now simply use any icon from the collections with this control.

<iconPacks:PackIconControl Kind="{x:Static iconPacks:PackIconBoxIconsKind.LogosAirbnb}" Width="24" Height="24" />

<iconPacks:PackIconControl Kind="{x:Static iconPacks:PackIconMaterialKind.AccessPoint}" Width="24" Height="24" />

WPF Sample

<Window x:Class="IconPacksTest.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" Title="IconPacks" Height="300" Width="300"> <Grid> <iconPacks:PackIconMaterial Kind="EmoticonCool" VerticalAlignment="Center" HorizontalAlignment="Center" /> </Grid> </Window>

UWP Sample

<Page x:Class="MahApps.Metro.IconPacks.Test.App.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:iconPacks="using:MahApps.Metro.IconPacks" mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <iconPacks:PackIconFontAwesome Width="32" Height="32" HorizontalAlignment="Center" VerticalAlignment="Center" Kind="AddressBookRegular" /> </Grid> </Page>

반응형