Reputation: 1
I want to change the date format of a datepicker control to display as shown below.
Äpr,23 - 2010
Any suggestions how to go about this ?
Upvotes: 0
Views: 333
Reputation: 22435
<Style TargetType="{x:Type DatePickerTextBox}">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<TextBox x:Name="PART_TextBox" Text="{Binding Path=SelectedDate, StringFormat='MMM, dd - yyyy',
RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Upvotes: 1