optimized performance

This commit is contained in:
NaBian committed 2020-06-28 22:39:27 +08:00
1 parent c407997a3c
commit 3162267795
65 files changed
+168 -168

No files matched your search

@@ -79,7 +79,7 @@ namespace HandyControl.Interactivity
{
get =>
(bool) GetValue(FloatAboveProperty);
set => SetValue(FloatAboveProperty, value);
set => SetValue(FloatAboveProperty, ValueBoxes.BooleanBox(value));
}
public TagType InitialTag
@@ -283,7 +283,7 @@ namespace HandyControl.Interactivity
private static void SetHasTransformWrapper(DependencyObject obj, bool value)
{
obj.SetValue(HasTransformWrapperProperty, value);
obj.SetValue(HasTransformWrapperProperty, ValueBoxes.BooleanBox(value));
}
private static void SetOverlay(DependencyObject obj, object value)
@@ -46,7 +46,7 @@ namespace HandyControl.Interactivity
{
get =>
(bool) GetValue(IsActiveProperty);
set => SetValue(IsActiveProperty, value);
set => SetValue(IsActiveProperty, ValueBoxes.BooleanBox(value));
}
protected virtual bool ShouldSkipInitialLayout =>
@@ -27,9 +27,8 @@ namespace HandyControl.Interactivity
public bool ConstrainToParentBounds
{
get =>
(bool) GetValue(ConstrainToParentBoundsProperty);
set => SetValue(ConstrainToParentBoundsProperty, value);
get => (bool) GetValue(ConstrainToParentBoundsProperty);
set => SetValue(ConstrainToParentBoundsProperty, ValueBoxes.BooleanBox(value));
}
private Rect ElementBounds
@@ -50,7 +50,7 @@ namespace HandyControl.Interactivity
public bool ConstrainToParentBounds
{
get => (bool)GetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty);
set => SetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty, value);
set => SetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty, ValueBoxes.BooleanBox(value));
}
private Rect ElementBounds
@@ -96,7 +96,7 @@ namespace HandyControl.Interactivity
public bool MustToggleIsEnabled
{
get => (bool) GetValue(MustToggleIsEnabledProperty);
set => SetValue(MustToggleIsEnabledProperty, value);
set => SetValue(MustToggleIsEnabledProperty, ValueBoxes.BooleanBox(value));
}
public bool MustToggleIsEnabledValue
@@ -127,7 +127,7 @@ namespace HandyControl.Interactivity
public bool AlwaysInvokeCommand
{
get => (bool) GetValue(AlwaysInvokeCommandProperty);
set => SetValue(AlwaysInvokeCommandProperty, value);
set => SetValue(AlwaysInvokeCommandProperty, ValueBoxes.BooleanBox(value));
}
protected override void OnAttached()
@@ -879,7 +879,7 @@ namespace HandyControl.Interactivity
internal static void SetDidCacheBackground(DependencyObject obj, bool value)
{
obj.SetValue(DidCacheBackgroundProperty, value);
obj.SetValue(DidCacheBackgroundProperty, ValueBoxes.BooleanBox(value));
}
internal static void SetLayoutStoryboard(DependencyObject obj, Storyboard value)
@@ -937,7 +937,7 @@ namespace HandyControl.Interactivity
public static void SetUseFluidLayout(DependencyObject obj, bool value)
{
obj.SetValue(UseFluidLayoutProperty, value);
obj.SetValue(UseFluidLayoutProperty, ValueBoxes.BooleanBox(value));
}
private static void StopAnimations()
@@ -3,6 +3,7 @@ using System.Globalization;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Media.Animation;
using HandyControl.Data;
namespace HandyControl.Interactivity
{
@@ -43,9 +44,8 @@ namespace HandyControl.Interactivity
public bool IsEnabled
{
get =>
(bool) GetValue(IsEnabledProperty);
set => SetValue(IsEnabledProperty, value);
get => (bool) GetValue(IsEnabledProperty);
set => SetValue(IsEnabledProperty, ValueBoxes.BooleanBox(value));
}
internal bool IsHosted