This commit is contained in:
NaBian committed 2020-06-18 23:41:41 +08:00
commit 67b97ea07b
2 files changed
+15 -23

No files matched your search

+3 -16
View File
@@ -20,24 +20,11 @@ jobs:
- name: Setup .NET Core - name: Setup .NET Core
uses: actions/setup-dotnet@master uses: actions/setup-dotnet@master
with:
dotnet-version: '5.0.100-preview.5.20279.10'
- name: Build Net_40 - name: Build Net_40
run: dotnet build src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj -p:Configuration=Release run: dotnet build src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj -p:Configuration=Release-Net40
- name: Build Net_45 - name: Build Net_45
run: dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj -p:Configuration=Release run: dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj -p:Configuration=Release
- name: Build Net_462
run: dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj -p:Configuration=Release
- name: Build Net_47
run: dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj -p:Configuration=Release
- name: Build Net_48
run: dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj -p:Configuration=Release
- name: Build Core_30
run: dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj --configuration Release
- name: Build Core_31
run: dotnet build src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj --configuration Release
@@ -1,4 +1,4 @@
using System; using System;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
@@ -178,11 +178,7 @@ namespace HandyControl.Controls
{ {
var ctl = (NumericUpDown)d; var ctl = (NumericUpDown)d;
var v = (double)e.NewValue; var v = (double)e.NewValue;
if (ctl._updateText && ctl._textBox != null) ctl.SetText();
{
ctl._textBox.Text = ctl.CurrentText;
ctl._textBox.Select(ctl._textBox.Text.Length, 0);
}
ctl.OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, ctl) ctl.OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, ctl)
{ {
@@ -190,6 +186,15 @@ namespace HandyControl.Controls
}); });
} }
private void SetText()
{
if (_updateText && _textBox != null)
{
_textBox.Text = CurrentText;
_textBox.Select(_textBox.Text.Length, 0);
}
}
private static object CoerceValue(DependencyObject d, object basevalue) private static object CoerceValue(DependencyObject d, object basevalue)
{ {
var ctl = (NumericUpDown)d; var ctl = (NumericUpDown)d;
@@ -205,7 +210,7 @@ namespace HandyControl.Controls
{ {
ctl.Value = maximum; ctl.Value = maximum;
} }
ctl.SetText();
return num > maximum ? maximum : num; return num > maximum ? maximum : num;
} }