I have a lot of styles in ResourceDictionary. For example like that:
<Style TargetType="{x:Type i:ButtonTool}" x:Key="UserButtonStyle" BasedOn="{StaticResource MenuButtonStyle}">
<Setter Property="LargeImage" Value="{DynamicResource UserIcon}" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="LargeImage" Value="{DynamicResource UserIconDisabled}"/>
</Trigger>
</Style.Triggers>
</Style>
And part of those styles are no longer in use. Application is still under development so I don’t know if they would be used in future.
I would like to know how does those unused styles influence the performance of application?
If it would be better to check which styles are in use and wchich are not and delete those unused styles. Or if it doesn’t really matter and it does not slow the application.
I am using WPF and .NET Framework 4.
Yes, it would be wise to remove them. Especially when the resources claim a lot of memory and/or take time to load.
This forum post show a couple of tools that can be used to find unused resources and a way to detect them.
Be aware though of dynamically loaded resources. You probably do not want to remove them.