Я нашел решение. Этот пост помог мне в этом Bind to GeometryDrawing bru sh. Спасибо Клеменсу. Но для этого мне пришлось избавиться от GeometryDrawing, потому что я не нашел способ привязки атрибута Bru sh.
Теперь мой словарь ресурсов содержит только объекты Geometry:
<ResourceDictionary x:Name="IconsResource" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApp6">
<Geometry x:Key="ErrorOutline">F1 M24,24z M0,0z M11,15L13,15 13,17 11,17z M11,7L13,7 13,13 11,13z M11.99,2C6.47,2 2,6.48 2,12 2,17.52 6.47,22 11.99,22 17.52,22 22,17.52 22,12 22,6.48 17.52,2 11.99,2z M12,20C7.58,20 4,16.42 4,12 4,7.58 7.58,4 12,4 16.42,4 20,7.58 20,12 20,16.42 16.42,20 12,20z</Geometry>
<Geometry x:Key="Check_circle">F1 M24,24z M0,0z M12,2C6.48,2 2,6.48 2,12 2,17.52 6.48,22 12,22 17.52,22 22,17.52 22,12 22,6.48 17.52,2 12,2z M10,17L5,12 6.41,10.59 10,14.17 17.59,6.58 19,8 10,17z</Geometry>
<Geometry x:Key="New_releases">F1 M24,24z M0,0z M23,12L20.56,9.22 20.9,5.54 17.29,4.72 15.4,1.54 12,3 8.6,1.54 6.71,4.72 3.1,5.53 3.44,9.21 1,12 3.44,14.78 3.1,18.47 6.71,19.29 8.6,22.47 12,21 15.4,22.46 17.29,19.28 20.9,18.46 20.56,14.78 23,12z M13,17L11,17 11,15 13,15 13,17z M13,13L11,13 11,7 13,7 13,13z</Geometry>
<Geometry x:Key="Sync_problem">F1 M24,24z M0,0z M3,12C3,14.21,3.91,16.2,5.36,17.64L3,20 9,20 9,14 6.76,16.24C5.68,15.15 5,13.66 5,12 5,9.39 6.67,7.17 9,6.35L9,4.26C5.55,5.15,3,8.27,3,12z M11,17L13,17 13,15 11,15 11,17z M21,4L15,4 15,10 17.24,7.76C18.32,8.85 19,10.34 19,12 19,14.61 17.33,16.83 15,17.65L15,19.74C18.45,18.85 21,15.73 21,12 21,9.79 20.09,7.8 18.64,6.36L21,4z M11,13L13,13 13,7 11,7 11,13z</Geometry>
<Geometry x:Key="Error">F1 M24,24z M0,0z M12,2C6.48,2 2,6.48 2,12 2,17.52 6.48,22 12,22 17.52,22 22,17.52 22,12 22,6.48 17.52,2 12,2z M13,17L11,17 11,15 13,15 13,17z M13,13L11,13 11,7 13,7 13,13z</Geometry>
</ResourceDictionary>
Основная идея - использовать элемент Path , поэтому:
<Window x:Class="WpfApp6.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionary1.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
<StackPanel>
<Path Stroke="{Binding ElementName=ColorBox, Path=Text}" Fill="{Binding ElementName=ColorBox, Path=Text}">
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=TextBox, Path=Text}" Value="1">
<Setter Property="Data" Value="{StaticResource Check_circle}" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=TextBox, Path=Text}" Value="2">
<Setter Property="Data" Value="{StaticResource Error}" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=TextBox, Path=Text}" Value="3">
<Setter Property="Data" Value="{StaticResource ErrorOutline}" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=TextBox, Path=Text}" Value="4">
<Setter Property="Data" Value="{StaticResource New_releases}" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=TextBox, Path=Text}" Value="5">
<Setter Property="Data" Value="{StaticResource Sync_problem}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
<TextBox Name="TextBox"></TextBox>
<TextBox Name="ColorBox">Green</TextBox>
</StackPanel>
</Grid>
</Window>