|
How to change Style at runtime in application-level Hi~
I want to change the style of all controls in application which
contains pages.
In document, I can use Style in Application.Resource
<Application.Resources>
<Style TargetType="{x:Type Button}"> ... </Style>
</Application.Resources>
But I can't change this style at runtime.
I try to use Application.Current.FindResource to get this style
reference and modify Setters, but get an InvalidOperationException, it
says the style is sealed(in use) and I can't modify it.
and I try to use BaseOn property to dynamically binding other style but
still get an exception.
Is there easier way to change a specified control's style in
application-level?
or release the sealed status of the style?
Thanks :-) |