Restore dynamic resource value
问题 I have a textblock tb with style. <TextBlock x:Name="tb" Style="{DynamicResource H1Style}" Text="Test"/> <Style TargetType="{x:Type TextBlock}" x:Key= "H1Style"> <Setter Property="FontSize" Value="18" /> <Setter Property="FontWeight" Value="Light"/> </Style> Then i change size tb.FontSize = 5; How do i restore style H1Style of tb? I tried set SetResourceReference , but FontSize still 5 instead of 18. tb.SetResourceReference(Control.StyleProperty, "H1Style"); 回答1: this line - tb.FontSize = 5;