tags:

views:

16

answers:

2

I'm a WCF newbie, and I wonder, is it possible to declare in XAML that all my TextBoxes should have a height of 26, for example? That is, not to set the height of each item individually?

+1  A: 

There is a link to a similar question on SO.

Gart
+1  A: 

You need to define a style for your textbox

This will style the textbox when required

<Style x:Key="myTextBoxStyle">
    <Setter Property="Height" Value="26" />
</Style>

<TextBox Text="Hi" Style="{StaticResource myTextBoxStyle}"/>

This will style all the textboxes

<Style TargetType="{x:Type TextBox}">
    <Setter Property="Height" Value="26" />
</Style>

Put your Style into your resources block

Veer