![]() |
VOOZH | about |
dotnet add package AltWPFTagControl --version 3.0.2412.11
NuGet\Install-Package AltWPFTagControl -Version 3.0.2412.11
<PackageReference Include="AltWPFTagControl" Version="3.0.2412.11" />
<PackageVersion Include="AltWPFTagControl" Version="3.0.2412.11" />Directory.Packages.props
<PackageReference Include="AltWPFTagControl" />Project file
paket add AltWPFTagControl --version 3.0.2412.11
#r "nuget: AltWPFTagControl, 3.0.2412.11"
#:package AltWPFTagControl@3.0.2412.11
#addin nuget:?package=AltWPFTagControl&version=3.0.2412.11Install as a Cake Addin
#tool nuget:?package=AltWPFTagControl&version=3.0.2412.11Install as a Cake Tool
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
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
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 net8.0-windows7.0 is compatible. net9.0-windows net9.0-windows was computed. net9.0-windows7.0 net9.0-windows7.0 is compatible. net10.0-windows net10.0-windows was computed. |
| .NET Framework | net461 net461 is compatible. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.2412.11 | 1,174 | 12/1/2024 |
| 3.0.2406.122 | 261 | 6/12/2024 |
| 2.0.0 | 990 | 6/15/2020 |
| 1.0.2 | 1,404 | 7/18/2018 |
| 1.0.1 | 1,540 | 7/18/2018 |
Refactored into a multi-targeting .Net Core compatible library