Reputation: 131
I want to do FindResource("{x:Type TextBox}")
or FindResource(GetType(TextBox))
and get a Style
object back?
Kind regards,
Upvotes: 0
Views: 394
Reputation: 169300
This will find an implicit Style
(without an x:Key
):
Style style = FindResource(typeof(Button)) as Style;
...that is defined in your XAML markup like this:
<Style TargetType="Button">
<Setter Property="FontSize" Value="40" />
</Style>
In VB.NET the corresponding code would be:
Dim style As Style = TryCast(FindResource(GetType(Button)), Style)
Upvotes: 1