AltWPFTagControl 3.0.2412.11

dotnet add package AltWPFTagControl --version 3.0.2412.11                
NuGet\Install-Package AltWPFTagControl -Version 3.0.2412.11                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AltWPFTagControl" Version="3.0.2412.11" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AltWPFTagControl --version 3.0.2412.11                
#r "nuget: AltWPFTagControl, 3.0.2412.11"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AltWPFTagControl as a Cake Addin
#addin nuget:?package=AltWPFTagControl&version=3.0.2412.11

// Install AltWPFTagControl as a Cake Tool
#tool nuget:?package=AltWPFTagControl&version=3.0.2412.11                

Alternative version of Kai Timmermann's WPF control to add/remove/edit tags/tokens

Differences:
  - Can be databound to any object (using Tags and DisplayMemberPath)
  - Scrollable view when there are two many Tags
  - Can be styled/themed to change the color, foreground and tags background
  - Tags are added via the datamodel not through the control itself

Screenshot

Getting Started

First import the package to all the relevant projects

Import-Package AltWPFTagControl

In the App.xaml import the template dictionary

   <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/WPFTagControl;component/Themes/ColorsAndIcons.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

In your view model, create an observable collection of the objects you want to use for tags

      Tags = new ObservableCollection<Thing>()
        {
            new Thing()
            {
                Name = "Tag 2",
                Value = 1,
            },
        };

Added the namespace to your window or controls

xmlns:cont="clr-namespace:WPFTagControl;assembly=WPFTagControl"

Lastly Add the control to the layout

        <cont:TagControl x:Name="ctl_Tags" BorderBrush="Gray" BorderThickness="1"
                     VerticalAlignment="Stretch" Tags="{Binding Tags}"
                     DisplayMemberPath="Name"
                     MaxHeight="74">
    </cont:TagControl>

Use the Tags property on TagControl to bind the items to the control and DisplayMemberPath to determine what property is used for the tag text

Styling

You can override the styling by providing alternatives to the resources list below. This can be done in the App.xaml or with the usercontrol or host controls.

<SolidColorBrush x:Key="TagHighlightBrush" Color="White" />


<SolidColorBrush x:Key="TagForegroundBrush" Color="White"/>

<LinearGradientBrush x:Key="TagBackgroundBrush" EndPoint="0,1">
    <GradientStop Offset="0" Color="#5890f0" />
    <GradientStop Offset="1" Color="#0351d7" />
</LinearGradientBrush>
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows7.0 is compatible. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.2412.11 79 12/1/2024
3.0.2406.122 151 6/12/2024
2.0.0 754 6/15/2020
1.0.2 1,015 7/18/2018
1.0.1 976 7/18/2018

Refactored into a multi-targeting .Net Core compatible library