feat: update property name.

This commit is contained in:
rabbitism
2024-01-14 23:33:36 +08:00
parent fecf22a5ec
commit 0f3883ed66
3 changed files with 8 additions and 8 deletions

View File

@@ -21,6 +21,6 @@
<u:NumericByteUpDown Name="inputByte" Step="1" Value="3" EmptyInputValue="1"></u:NumericByteUpDown>
<TextBlock Text="{Binding #inputByte.Value}"></TextBlock>
<TextBlock Text="Drag"></TextBlock>
<u:NumericIntUpDown Step="1" Value="2" Watermark="Input Value" TextEditable="False" />
<u:NumericIntUpDown Step="1" Value="2" Watermark="Input Value" IsTextEditable="False" />
</StackPanel>
</UserControl>

View File

@@ -38,7 +38,7 @@
VerticalAlignment="Stretch"
Background="Transparent"
Cursor="SizeAll"
IsVisible="{TemplateBinding TextEditable,
IsVisible="{TemplateBinding IsTextEditable,
Converter={x:Static BoolConverters.Not}}" />
</Panel>
</ButtonSpinner>

View File

@@ -27,13 +27,13 @@ public abstract class NumericUpDown : TemplatedControl
private Point? _point;
protected internal bool _updateFromTextInput;
public static readonly StyledProperty<bool> TextEditableProperty = AvaloniaProperty.Register<NumericUpDown, bool>(
nameof(TextEditable), defaultValue: true);
public static readonly StyledProperty<bool> IsTextEditableProperty = AvaloniaProperty.Register<NumericUpDown, bool>(
nameof(IsTextEditable), defaultValue: true);
public bool TextEditable
public bool IsTextEditable
{
get => GetValue(TextEditableProperty);
set => SetValue(TextEditableProperty, value);
get => GetValue(IsTextEditableProperty);
set => SetValue(IsTextEditableProperty, value);
}
public static readonly StyledProperty<bool> IsReadOnlyProperty = AvaloniaProperty.Register<NumericUpDown, bool>(
@@ -207,7 +207,7 @@ public abstract class NumericUpDown : TemplatedControl
private void OnDragPanelPointerMoved(object sender, PointerEventArgs e)
{
if (TextEditable) return;
if (IsTextEditable) return;
if(!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
var point = e.GetPosition(this);
var delta = point - _point;