This project has moved. For the latest updates, please go here.

Padding property in styles

Dec 18, 2011 at 7:02 PM

Hello,

1.  I see that you use Padding=0 in your Generic.xaml style on the DateTimePicker control.

                                                Foreground="{TemplateBinding Foreground}" 
                                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
                                                MinWidth="20" AcceptsReturn="False" 
                                           Padding="0 "
                                                TextAlignment="{TemplateBinding TextAlignment}"
                                                TextWrapping="NoWrap" 
                                                TabIndex="{TemplateBinding TabIndex}"

Is there a specific reason for this ?

Why not to set it as:

                                                Padding="{TemplateBinding Padding}"

 so as to have padding as well ?   I noticed that you use it in other controls as well.

 

 2. Why not use an icon picture property for the datetimepicker's calendar toggle button ?   I know it can be styled, but many people would like to have this

 

--theo

 

 

Dec 20, 2011 at 8:38 PM

1. I forgot the exact reason, but I am sure I did it for a reason.  I will look at it again after the holidays.

2. Using an icon is not the common way of indicating a date time picker.  Most major vendors follow the same guidelines that I do.  If you would like one you can retemplate the control.