Browse Source

Fixed bug in DateTimeUpDown when not changing the Format, null exception would occur when changing values.

Added default foreground colors to editors to controls like the DataGrid will not change the foreground color.
pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
991992fb97
  1. 3
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/DateTimeUpDown.cs
  2. 3
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml

3
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/DateTimeUpDown.cs

@ -22,7 +22,7 @@ namespace Microsoft.Windows.Controls
#region Format
public static readonly DependencyProperty FormatProperty = DependencyProperty.Register("Format", typeof(DateTimeFormat), typeof(DateTimeUpDown), new UIPropertyMetadata(DateTimeFormat.ShortTime, OnFormatChanged));
public static readonly DependencyProperty FormatProperty = DependencyProperty.Register("Format", typeof(DateTimeFormat), typeof(DateTimeUpDown), new UIPropertyMetadata(DateTimeFormat.FullDateTime, OnFormatChanged));
public DateTimeFormat Format
{
get { return (DateTimeFormat)GetValue(FormatProperty); }
@ -56,6 +56,7 @@ namespace Microsoft.Windows.Controls
public DateTimeUpDown()
{
DateTimeFormatInfo = DateTimeFormatInfo.GetInstance(CultureInfo.CurrentCulture);
InitializeDateTimeInfoList();
}
protected override void OnValueChanged(object oldValue, object newValue)

3
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Themes/Generic.xaml

@ -961,6 +961,7 @@
<!-- =============================================================================== -->
<Style TargetType="{x:Type local:NumericUpDown}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<Setter.Value>
@ -988,6 +989,7 @@
<!-- =============================================================================== -->
<Style TargetType="{x:Type local:DateTimeUpDown}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<Setter.Value>
@ -1015,6 +1017,7 @@
<!-- =============================================================================== -->
<Style TargetType="{x:Type local:MaskedTextBox}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Focusable" Value="False" />
<Setter Property="Template">
<Setter.Value>

Loading…
Cancel
Save