I would probably use an attached dependency property instead of the tag, something like this
<Window x:Class="test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:test"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="local:ButtonThing.Tag2" Value="2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ControlTemplate.Triggers>
<Trigger Property="local:ButtonThing.Tag2" Value="1">
<Setter Property="Background" Value="Red"/>
</Trigger>
<Trigger Property="local:ButtonThing.Tag2" Value="2">
<Setter Property="Background" Value="Blue"/>
</Trigger>
</ControlTemplate.Triggers>
<Grid Background="{TemplateBinding Background}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Button local:ButtonThing.Tag2="1"/>
</Grid>
</Window>
And the code behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace test
{
public class ButtonThing : DependencyObject
{
public static object GetTag2(DependencyObject obj)
{
return (object)obj.GetValue(Tag2Property);
}
public static void SetTag2(DependencyObject obj, object value)
{
obj.SetValue(Tag2Property, value);
}
public static readonly DependencyProperty Tag2Property = DependencyProperty.RegisterAttached("Tag2", typeof(object), typeof(ButtonThing), new PropertyMetadata(null));
}
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}