tags:

views:

20

answers:

2

I'd like to be able to maintain the width of controls globally throughout my WPF application.

Previously in winforms world I'd override onload in a base form and iterate through all controls and containers and determine the type of controls and set the dimensions accordingly.

I guess I could do the same in WPF but is there any better way to do this?

+1  A: 

Set a Style for TextBox at the highest level in your Visual Hierarchy.

Reed Copsey
Perfect, thank you.I knew there was something (major) I was missing :)
John B
+1  A: 

Define TextBox style in the resource dictionary and put a setter to set the desired width

<Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}">
    <Setter Property="Width" Value="200" />
      ..........
</Style>
Jobi Joy