DateTimePicker.xaml 1.1 KB

1234567891011121314151617181920212223
  1. <DatePicker x:Class="CustomControls.DateTimePicker"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:CustomControls"
  7. mc:Ignorable="d"
  8. d:DesignHeight="25" d:DesignWidth="100">
  9. <DatePicker.Resources>
  10. <Style TargetType="{x:Type DatePickerTextBox}">
  11. <Setter Property="Control.Template">
  12. <Setter.Value>
  13. <ControlTemplate>
  14. <TextBox x:Name="PART_TextBox"
  15. Text="{Binding Path=FormattedValue,
  16. RelativeSource={RelativeSource AncestorType={x:Type local:DateTimePicker}}}"
  17. BorderThickness="0" Margin="0,1,0,0" />
  18. </ControlTemplate>
  19. </Setter.Value>
  20. </Setter>
  21. </Style>
  22. </DatePicker.Resources>
  23. </DatePicker>