From 090be3ce3b0fdcc51e1c3fb9ac3d197b047bca9f Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 21 Mar 2024 17:25:55 +0800 Subject: [PATCH] fix: 1. simplify code for nullable control event assignment. 2. make textbox readonly and dragpanel visible controlled in code behind. 3. Use compile binding in demo. --- demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml | 3 + .../Controls/NumericUpDown.axaml | 4 +- .../NumericUpDown/NumericUpDownBase.cs | 127 +++++++++--------- 3 files changed, 71 insertions(+), 63 deletions(-) diff --git a/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml b/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml index 753a232..77b0def 100644 --- a/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml +++ b/demo/Ursa.Demo/Pages/NumericUpDownDemo.axaml @@ -5,6 +5,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:u="https://irihi.tech/ursa" + xmlns:vm="using:Ursa.Demo.ViewModels" + x:DataType="vm:NumericUpDownDemoViewModel" + x:CompileBindings="True" d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> diff --git a/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml b/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml index d15bc7c..ba5141d 100644 --- a/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml +++ b/src/Ursa.Themes.Semi/Controls/NumericUpDown.axaml @@ -52,7 +52,6 @@ FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" InnerLeftContent="{TemplateBinding InnerLeftContent}" - IsReadOnly="{TemplateBinding IsReadOnly}" TextWrapping="NoWrap" Theme="{DynamicResource NonErrorTextBox}" Watermark="{TemplateBinding Watermark}" /> @@ -61,8 +60,7 @@ HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent" - Cursor="SizeAll" - IsVisible="{TemplateBinding AllowDrag}" /> + Cursor="SizeAll"/>