AltWPFTagControl 3.0.2406.122
dotnet add package AltWPFTagControl --version 3.0.2406.122
NuGet\Install-Package AltWPFTagControl -Version 3.0.2406.122
<PackageReference Include="AltWPFTagControl" Version="3.0.2406.122" />
paket add AltWPFTagControl --version 3.0.2406.122
#r "nuget: AltWPFTagControl, 3.0.2406.122"
// Install AltWPFTagControl as a Cake Addin #addin nuget:?package=AltWPFTagControl&version=3.0.2406.122 // Install AltWPFTagControl as a Cake Tool #tool nuget:?package=AltWPFTagControl&version=3.0.2406.122
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
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.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. |
-
.NETFramework 4.6.1
- DotNetProjects.WpfToolkit.Input (>= 6.1.94)
- DotNetProjects.WpfToolkit.Layout (>= 6.1.94)
-
net8.0-windows7.0
- DotNetProjects.WpfToolkit.Input (>= 6.1.94)
- DotNetProjects.WpfToolkit.Layout (>= 6.1.94)
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.2406.122 | 139 | 6/12/2024 |
2.0.0 | 746 | 6/15/2020 |
1.0.2 | 1,011 | 7/18/2018 |
1.0.1 | 972 | 7/18/2018 |
Refactored into a multi-targeting .Net Core compatible library