Skip to content

Commit

Permalink
Merge pull request #239 from MahApps/icons/FileIconsv2.1.43
Browse files Browse the repository at this point in the history
Add File Icons v2.1.43
  • Loading branch information
punker76 authored Oct 12, 2020
2 parents 59396c0 + 55e53a1 commit 052cb55
Show file tree
Hide file tree
Showing 25 changed files with 2,328 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ This `IconPacks` library contains controls, markup extensions and converters to
| [Entypo+](http://www.entypo.com/) | | 411 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Entypo/"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Entypo.svg?style=flat-square&&label=Entypo"></a> |
| [Eva Icons](https://github.com/akveo/eva-icons) | 1.1.3 | 490 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.EvaIcons/"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.EvaIcons.svg?style=flat-square&&label=EvaIcons"></a> |
| [Feather Icons](https://github.com/feathericons/feather) | 4.28.0 | 286 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.FeatherIcons/"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.FeatherIcons.svg?style=flat-square&&label=FeatherIcons"></a> |
| [File Icons](https://github.com/file-icons/icons) | 2.1.43 | 876 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.FileIcons/"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.FileIcons.svg?style=flat-square&&label=FileIcons"></a> |
| [Font Awesome Free](https://fontawesome.com/) | 5.14.0 | 1601 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.FontAwesome/"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.FontAwesome.svg?style=flat-square&&label=FontAwesome"></a> |
| [Ionicons](https://ionicons.com/) | 4.6.4.1 | 696 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.Ionicons/"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.Ionicons.svg?style=flat-square&&label=Ionicons"></a> |
| [Jam Icons](https://github.com/michaelampr/jam) | 2.0.0 | 896 | <a href="https://www.nuget.org/packages/MahApps.Metro.IconPacks.JamIcons/"><img src="https://img.shields.io/nuget/dt/MahApps.Metro.IconPacks.JamIcons.svg?style=flat-square&&label=JamIcons"></a> |
Expand Down
30 changes: 30 additions & 0 deletions src/MahApps.Metro.IconPacks.Browser/Styles/CustomTabControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,23 @@
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IconType}" Value="{x:Type iconPacks:PackIconFileIconsKind}">
<Setter TargetName="IconContent" Property="ContentTemplate">
<Setter.Value>
<DataTemplate DataType="{x:Type viewModels:IIconViewModel}">
<iconPacks:PackIconFileIcons Width="{TemplateBinding ActualWidth}"
Height="{TemplateBinding ActualHeight}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BorderBrush="{StaticResource SelectedIconBorderBrush}"
BorderThickness="1"
Foreground="{DynamicResource MahApps.Brushes.AccentBase}"
Kind="{Binding Value, Mode=OneWay, Converter={converter:NullToUnsetValueConverter}}"
SnapsToDevicePixels="True" />
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IconType}" Value="{x:Type iconPacks:PackIconIoniconsKind}">
<Setter TargetName="IconContent" Property="ContentTemplate">
<Setter.Value>
Expand Down Expand Up @@ -895,6 +912,19 @@
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IconType}" Value="{x:Type iconPacks:PackIconFileIconsKind}">
<Setter TargetName="IconContent" Property="ContentTemplate">
<Setter.Value>
<DataTemplate DataType="{x:Type viewModels:IIconViewModel}">
<iconPacks:PackIconFileIcons Width="32"
Height="32"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Kind="{Binding Value, Mode=OneWay}" />
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IconType}" Value="{x:Type iconPacks:PackIconIoniconsKind}">
<Setter TargetName="IconContent" Property="ContentTemplate">
<Setter.Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public MainViewModel(Dispatcher dispatcher)
new IconPackViewModel(this, "Entypo+", typeof(PackIconEntypoKind), typeof(PackIconEntypo)),
new IconPackViewModel(this, "EvaIcons", typeof(PackIconEvaIconsKind), typeof(PackIconEvaIcons)),
new IconPackViewModel(this, "FeatherIcons", typeof(PackIconFeatherIconsKind), typeof(PackIconFeatherIcons)),
new IconPackViewModel(this, "FileIcons", typeof(PackIconFileIconsKind), typeof(PackIconFileIcons)),
new IconPackViewModel(this, "FontAwesome", typeof(PackIconFontAwesomeKind), typeof(PackIconFontAwesome)),
new IconPackViewModel(this, "Ionicons", typeof(PackIconIoniconsKind), typeof(PackIconIonicons)),
new IconPackViewModel(this, "JamIcons", typeof(PackIconJamIconsKind), typeof(PackIconJamIcons)),
Expand Down Expand Up @@ -54,6 +55,7 @@ public MainViewModel(Dispatcher dispatcher)
typeof(PackIconEntypoKind),
typeof(PackIconEvaIconsKind),
typeof(PackIconFeatherIconsKind),
typeof(PackIconFileIconsKind),
typeof(PackIconFontAwesomeKind),
typeof(PackIconIoniconsKind),
typeof(PackIconJamIconsKind),
Expand Down Expand Up @@ -83,6 +85,7 @@ public MainViewModel(Dispatcher dispatcher)
typeof(PackIconEntypo),
typeof(PackIconEvaIcons),
typeof(PackIconFeatherIcons),
typeof(PackIconFileIcons),
typeof(PackIconFontAwesome),
typeof(PackIconIonicons),
typeof(PackIconJamIcons),
Expand Down
14 changes: 14 additions & 0 deletions src/MahApps.Metro.IconPacks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.Eva
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.FeatherIcons", "MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.FeatherIcons.csproj", "{CC959E4E-85E0-4142-A733-3035E6E61C96}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.FileIcons", "MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.FileIcons.csproj", "{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.FontAwesome", "MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.FontAwesome.csproj", "{C7F2A63D-0B08-41BA-BE0C-ECBB2CC6ADFF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro.IconPacks.Ionicons", "MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.Ionicons.csproj", "{FE8EA04F-2AA5-4060-A6EA-53B43F94EF96}"
Expand Down Expand Up @@ -426,6 +428,18 @@ Global
{D9BF4500-ED93-4879-8C21-009CA7886AA1}.Release|x64.Build.0 = Release|Any CPU
{D9BF4500-ED93-4879-8C21-009CA7886AA1}.Release|x86.ActiveCfg = Release|Any CPU
{D9BF4500-ED93-4879-8C21-009CA7886AA1}.Release|x86.Build.0 = Release|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Debug|x64.ActiveCfg = Debug|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Debug|x64.Build.0 = Debug|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Debug|x86.ActiveCfg = Debug|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Debug|x86.Build.0 = Debug|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Release|Any CPU.Build.0 = Release|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Release|x64.ActiveCfg = Release|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Release|x64.Build.0 = Release|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Release|x86.ActiveCfg = Release|Any CPU
{7BFC8DCC-D9CB-4E51-8C30-82A5B36EAEF1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
76 changes: 76 additions & 0 deletions src/MahApps.Metro.IconPacks/Icons/FileIcons/PackIconFileIcons.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
#if (NETFX_CORE || WINDOWS_UWP)
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
#else
using System.Windows;
#endif

namespace MahApps.Metro.IconPacks
{
/// <summary>
/// File Icons are licensed under the [MIT license](<see><cref>https://github.com/file-icons/atom/blob/master/LICENSE.md</cref></see>).
/// Contributions, corrections and requests can be made on GitHub <see><cref>https://github.com/file-icons/icons</cref></see>.
/// </summary>
[MetaData("https://github.com/file-icons/icons", "https://github.com/file-icons/atom/blob/master/LICENSE.md")]
public class PackIconFileIcons : PackIconControlBase
{
public static readonly DependencyProperty KindProperty
= DependencyProperty.Register(nameof(Kind), typeof(PackIconFileIconsKind), typeof(PackIconFileIcons), new PropertyMetadata(default(PackIconFileIconsKind), KindPropertyChangedCallback));

private static void KindPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue != e.OldValue)
{
((PackIconFileIcons)dependencyObject).UpdateData();
}
}

/// <summary>
/// Gets or sets the icon to display.
/// </summary>
public PackIconFileIconsKind Kind
{
get { return (PackIconFileIconsKind)GetValue(KindProperty); }
set { SetValue(KindProperty, value); }
}

#if !(NETFX_CORE || WINDOWS_UWP)
static PackIconFileIcons()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PackIconFileIcons), new FrameworkPropertyMetadata(typeof(PackIconFileIcons)));
}
#endif

public PackIconFileIcons()
{
#if NETFX_CORE || WINDOWS_UWP
this.DefaultStyleKey = typeof(PackIconFileIcons);
#endif
}

protected override void SetKind<TKind>(TKind iconKind)
{
#if NETFX_CORE || WINDOWS_UWP
BindingOperations.SetBinding(this, PackIconFileIcons.KindProperty, new Binding() { Source = iconKind, Mode = BindingMode.OneTime });
#else
this.SetCurrentValue(KindProperty, iconKind);
#endif
}

protected override void UpdateData()
{
if (Kind != default(PackIconFileIconsKind))
{
string data = null;
PackIconFileIconsDataFactory.DataIndex.Value?.TryGetValue(Kind, out data);
this.Data = data;
}
else
{
this.Data = null;
}
}
}
}
Loading

0 comments on commit 052cb55

Please sign in to comment.