mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-28 14:20:47 +08:00
perf(controls): reduce allocation and state sync overhead
This commit is contained in:
@@ -311,13 +311,24 @@ public class TextBox : AvaloniaTextBox,
|
||||
|
||||
void ICompactSpaceAware.NotifyPositionChange(SpaceItemPosition? position)
|
||||
{
|
||||
IsUsedInCompactSpace = position != null;
|
||||
CompactSpaceItemPosition = position;
|
||||
var isUsedInCompactSpace = position != null;
|
||||
if (IsUsedInCompactSpace != isUsedInCompactSpace)
|
||||
{
|
||||
IsUsedInCompactSpace = isUsedInCompactSpace;
|
||||
}
|
||||
|
||||
if (CompactSpaceItemPosition != position)
|
||||
{
|
||||
CompactSpaceItemPosition = position;
|
||||
}
|
||||
}
|
||||
|
||||
void ICompactSpaceAware.NotifyOrientationChange(Orientation orientation)
|
||||
{
|
||||
CompactSpaceOrientation = orientation;
|
||||
if (CompactSpaceOrientation != orientation)
|
||||
{
|
||||
CompactSpaceOrientation = orientation;
|
||||
}
|
||||
}
|
||||
|
||||
double ICompactSpaceAware.GetBorderThickness()
|
||||
@@ -371,7 +382,10 @@ public class TextBox : AvaloniaTextBox,
|
||||
|
||||
protected virtual void NotifySetFeedBackControl(FormValidateFeedback? value)
|
||||
{
|
||||
FormFeedback = value;
|
||||
if (!ReferenceEquals(FormFeedback, value))
|
||||
{
|
||||
FormFeedback = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user