https://github.com/point-platform/famfamfam-flags-wpf
famfamfam flag icons for WPF
https://github.com/point-platform/famfamfam-flags-wpf
country-flags csharp dotnet famfamfam flag-icons flags icons iso-3166-1 wpf
Last synced: 2 months ago
JSON representation
famfamfam flag icons for WPF
- Host: GitHub
- URL: https://github.com/point-platform/famfamfam-flags-wpf
- Owner: point-platform
- License: apache-2.0
- Created: 2017-03-22T19:17:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-16T00:53:49.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T09:46:55.351Z (3 months ago)
- Topics: country-flags, csharp, dotnet, famfamfam, flag-icons, flags, icons, iso-3166-1, wpf
- Language: C#
- Size: 392 KB
- Stars: 30
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/FamFamFam.Flags.Wpf/)
# FamFamFam flag icons for WPF
A simple library for showing flags in WPF.

## Installation
Source from [NuGet](https://www.nuget.org/packages/FamFamFam.Flags.Wpf/):
> Install-Package FamFamFam.Flags.Wpf
## Usage
The following code creates an image of flag that corresonds to the [two letter ISO 3166-1 alpha-2 country
code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) that is resolved by the binding expression.
Note that you may have to include a path in your binding, depending upon the structure of your `DataContext`.```xaml
```
The converter in this binding transforms the country code into an `ImageSource`.
This requires an instance of the converter class to be within scope as a resource.You might use code such as this somewhere up the logical tree:
```xaml
```
You will also have to declare the `Flags` XML namespace by including this code as an attribute on any ancestor node of the above declaration.
```xaml
xmlns:Flags="clr-namespace:FamFamFam.Flags.Wpf;assembly=FamFamFam.Flags.Wpf"
```If images appear blurry, set `UseLayoutRounding` to `true` on a parent element, and be sure to use
`RenderOptions.BitmapScalingMode="HighQuality"` on the `` itself.You could show a `ComboBox` of country flags and names using the following code:
```xaml
```
The result would resemble:

## Coverage
As noted in `CountryData.cs`:
* FamFamFam Flags includes images for non-ISO 3166-1 entities
* `an`
* `catalonia`
* `cs`
* `en`
* `eu`
* `scotland`
* `wales`
* FamFamFam Flags doesn't cover ISO 3166-1 entities:
* `aq` (Antarctica)
* `bq` (Bonaire, Sint Eustatius and Saba)
* ~`cw` (Curaçao)~
* `im` (Isle of Man)
* `je` (Jersey)
* `bl` (Saint Barthélemy)
* `mf` (Saint Martin (French part))
* `sx` (Sint Maarten (Dutch part))
* `ss` (South Sudan)The `cw` (Curaçao) flag was [provided by @serdam55](https://github.com/point-platform/famfamfam-flags-wpf/issues/1).
## Credits
The flag icons were created by Mark James as the [famfamfam flag icon set](http://www.famfamfam.com/lab/icons/flags/),
and are available for free use for any purpose with no requirement for attribution.This library was created by Drew Noakes in 2009 and was hosted [here](https://www.drewnoakes.com/code/wpf/flags/)
until moved to [GitHub](https://github.com/drewnoakes/famfamfam-flags-wpf) and NuGet in 2017.