mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:46:30 +00:00
fix dataset explorer view
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type local:NumericUpDown}}}"
|
||||
TextChanged="NUDTextBox_OnTextChanged"/>
|
||||
LostFocus="NudTextBox_OnLostFocus"
|
||||
/>
|
||||
<RepeatButton
|
||||
Name="NudButtonUp"
|
||||
Grid.Column="1"
|
||||
|
||||
@@ -56,7 +56,25 @@ public partial class NumericUpDown : UserControl
|
||||
}
|
||||
}
|
||||
|
||||
private void NUDTextBox_OnTextChanged(object sender, TextChangedEventArgs e)
|
||||
private void NudButtonUp_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var step = Step <= 0 ? 1m : Step;
|
||||
var newVal = Math.Min(MaxValue, Value + step);
|
||||
Value = newVal;
|
||||
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||
}
|
||||
|
||||
private void NudButtonDown_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var step = Step <= 0 ? 1m : Step;
|
||||
var newVal = Math.Max(MinValue, Value - step);
|
||||
Value = newVal;
|
||||
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||
}
|
||||
|
||||
private void NudTextBox_OnLostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(NudTextBox.Text) || !decimal.TryParse(NudTextBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out var number))
|
||||
{
|
||||
@@ -80,22 +98,4 @@ public partial class NumericUpDown : UserControl
|
||||
|
||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||
}
|
||||
|
||||
private void NudButtonUp_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var step = Step <= 0 ? 1m : Step;
|
||||
var newVal = Math.Min(MaxValue, Value + step);
|
||||
Value = newVal;
|
||||
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||
}
|
||||
|
||||
private void NudButtonDown_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var step = Step <= 0 ? 1m : Step;
|
||||
var newVal = Math.Max(MinValue, Value - step);
|
||||
Value = newVal;
|
||||
NudTextBox.Text = Value.ToString(CultureInfo.InvariantCulture);
|
||||
NudTextBox.SelectionStart = NudTextBox.Text.Length;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user