Hi,
I have found a strange bug with ResourceDictionary and VS 2k5, when running
a exe twice i get a "Item already added" error in ResourceDictionary.
Here is a code sample :
Build the projet, run it in debug, close the window, modify the file (add aCode:<Window x:Class="TestWinFX.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TestWinFX" Height="82" Width="141" > <!-- Resources --> <Window.Resources> <!-- Gradients --> <LinearGradientBrush x:Key="MyGradient" StartPoint="0,0" EndPoint="0,1"> <LinearGradientBrush.GradientStops> <GradientStop Color="#FFFFFFFF" Offset="0" /> <GradientStop Color="#FFFF0000" Offset="1" /> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </Window.Resources> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Height="37" Width="99"> <Button VerticalAlignment="Center" HorizontalAlignment="Center" Width="89" Height="27" Name="button1" Content="MyButton"> <Button.Template> <ControlTemplate> <Grid> <Rectangle Stroke="Black" Fill="{DynamicResource MyGradient}" RadiusX="5" RadiusY="5" /> <ContentPresenter Content="{TemplateBinding Button.Content}" HorizontalAlignment="{TemplateBinding Button.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Button.VerticalContentAlignment}" /> </Grid> </ControlTemplate> </Button.Template> </Button> </StackPanel> </Window>
return anywhere), build and run, you have the bug.
Only solution i found is force a rebuild and not a build.
Any idea of where it comes from ?
Guillaume


