Jdenticon.Wpf Namespace

Classes for using Jdenticon in WPF.

Classes

Public classFloatRangeConverter
Public classCode exampleIdenticonElement
Element that renders and displays an identicon.

Examples

Install Jdenticon.Wpf

To use Jdenticon in a WPF application, start with installing the Jdenticon.Wpf NuGet package.

NuGet Package Manager
PM> Install-Package Jdenticon.Wpf

Use IdenticonElement

Now you can add the IdenticonElement where in your application. Don't forget to add the Jdenticon XML namespace.

Example usage in WPF
<Window x:Class="SampleApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:jd="clr-namespace:Jdenticon.Wpf;assembly=Jdenticon.Wpf"
        Title="MainWindow" Height="250" Width="600">
    <Window.Resources>
        <Style TargetType="{x:Type jd:IdenticonElement}">
            <Setter Property="Width" Value="100" />
            <Setter Property="Height" Value="100" />
            <Setter Property="Margin" Value="10" />
        </Style>
    </Window.Resources>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
        <jd:IdenticonElement Value="icon1" />
        <jd:IdenticonElement Value="icon2" />
        <jd:IdenticonElement Value="icon3" />
        <jd:IdenticonElement Value="icon4" />
    </StackPanel>
</Window>

This is the resulting application:

Sample WPF application with four identicons

Binding

To make the identicon useful you probably want to make a binding to the Value property. The value decides what the icon will look like.

Example usage in WPF
<jd:IdenticonElement Value="{Binding Path=UserID}" />