views:

9

answers:

1

In my file.xaml, how can I set the TextBlock default size, so that I don't have to include that attribute in the TextBlock element?

<UserControl.Resources>
 <!-- how?/can i set the default font size for textblock element here? -->
</UserControl.Resources>

<Grid>
    <StackPanel>
        <TextBlock Text="{Binding HelloWorld}" />
    </StackPanel>
</Grid>
+1  A: 

Place this instead of your comment at UserControl.Resources

<Style TargetType="TextBlock">
    <Setter Property="FontSize" Value="20" />
</Style>
Eugene Cheverda