Browse Source

Bugfix: Double Value Can Contain Decimals

pull/650/head
jkuehner 11 years ago
parent
commit
1bc0ed951f
  1. 20
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/NumberEditor.xaml.cs

20
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/NumberEditor.xaml.cs

@ -117,16 +117,20 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors @@ -117,16 +117,20 @@ namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors
Maximum = range.Max;
}
if (Minimum == 0 && Maximum == 1) {
if (type == typeof(double) || type == typeof(decimal)) {
DecimalPlaces = 2;
SmallChange = 0.01;
LargeChange = 0.1;
}
else {
ClearValue(DecimalPlacesProperty);
ClearValue(SmallChangeProperty);
ClearValue(LargeChangeProperty);
}
// if (Minimum == 0 && Maximum == 1) {
// DecimalPlaces = 2;
// SmallChange = 0.01;
// LargeChange = 0.1;
// }
// else {
// ClearValue(DecimalPlacesProperty);
// ClearValue(SmallChangeProperty);
// ClearValue(LargeChangeProperty);
// }
}
public override void OnApplyTemplate()

Loading…
Cancel
Save