|
@@ -21,7 +21,7 @@ namespace PDF_Master.CustomControl
|
|
|
/// </summary>
|
|
|
public partial class NumericUpDown : UserControl
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
|
|
|
public string Text
|
|
|
{
|
|
@@ -68,6 +68,7 @@ namespace PDF_Master.CustomControl
|
|
|
if (control != null)
|
|
|
{
|
|
|
control.TextBox_Num.Text = Convert.ToString(value);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -90,7 +91,8 @@ namespace PDF_Master.CustomControl
|
|
|
public double Minimum
|
|
|
{
|
|
|
get { return (double)GetValue(MinimumProperty); }
|
|
|
- set {
|
|
|
+ set
|
|
|
+ {
|
|
|
SetValue(MinimumProperty, value);
|
|
|
}
|
|
|
}
|
|
@@ -166,7 +168,7 @@ namespace PDF_Master.CustomControl
|
|
|
targetvalue = Minimum;
|
|
|
}
|
|
|
|
|
|
- if(targetvalue<Minimum)
|
|
|
+ if (targetvalue < Minimum)
|
|
|
{
|
|
|
targetvalue = Minimum;
|
|
|
}
|
|
@@ -219,9 +221,10 @@ namespace PDF_Master.CustomControl
|
|
|
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- if (string.IsNullOrEmpty(Text))
|
|
|
+ //修复控件初始化显示固定值的问题
|
|
|
+ if (Value >= Minimum)
|
|
|
{
|
|
|
- Text = Minimum.ToString();
|
|
|
+ Text = Value.ToString();
|
|
|
}
|
|
|
}
|
|
|
}
|