Optimized performance
This commit is contained in:
1 parent
76f7b5a247
commit
042c6bd4e4
34 files changed
+97
-81
No files matched your search
@@ -4,6 +4,7 @@ using System.Windows;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
{
|
{
|
||||||
@@ -46,7 +47,7 @@ namespace HandyControl.Controls
|
|||||||
/// 路径长度
|
/// 路径长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty PathLengthProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty PathLengthProperty = DependencyProperty.Register(
|
||||||
"PathLength", typeof(double), typeof(AnimationPath), new FrameworkPropertyMetadata(default(double),
|
"PathLength", typeof(double), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
|
||||||
OnPropertiesChanged));
|
OnPropertiesChanged));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
|
|||||||
public static object GetBottomContent(DependencyObject element) => element.GetValue(BottomContentProperty);
|
public static object GetBottomContent(DependencyObject element) => element.GetValue(BottomContentProperty);
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowEdgeContentProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty ShowEdgeContentProperty = DependencyProperty.RegisterAttached(
|
||||||
"ShowEdgeContent", typeof(bool), typeof(EdgeElement), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowEdgeContent", typeof(bool), typeof(EdgeElement), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public static void SetShowEdgeContent(DependencyObject element, bool value) => element.SetValue(ShowEdgeContentProperty, value);
|
public static void SetShowEdgeContent(DependencyObject element, bool value) => element.SetValue(ShowEdgeContentProperty, value);
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否必填
|
/// 是否必填
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty NecessaryProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty NecessaryProperty = DependencyProperty.RegisterAttached(
|
||||||
"Necessary", typeof(bool), typeof(InfoElement), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.Inherits));
|
"Necessary", typeof(bool), typeof(InfoElement), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits));
|
||||||
|
|
||||||
public static void SetNecessary(DependencyObject element, bool value) => element.SetValue(NecessaryProperty, value);
|
public static void SetNecessary(DependencyObject element, bool value) => element.SetValue(NecessaryProperty, value);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
@@ -20,7 +21,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否监测
|
/// 是否监测
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsMonitoringProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty IsMonitoringProperty = DependencyProperty.RegisterAttached(
|
||||||
"IsMonitoring", typeof(bool), typeof(PasswordBoxMonitor), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.Inherits, OnIsMonitoringChanged));
|
"IsMonitoring", typeof(bool), typeof(PasswordBoxMonitor), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnIsMonitoringChanged));
|
||||||
|
|
||||||
private static void OnIsMonitoringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
private static void OnIsMonitoringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否隐藏元素
|
/// 是否隐藏元素
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty HiddenElementProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty HiddenElementProperty = DependencyProperty.RegisterAttached(
|
||||||
"HiddenElement", typeof(bool), typeof(StatusSwitchElement), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"HiddenElement", typeof(bool), typeof(StatusSwitchElement), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public static void SetHiddenElement(DependencyObject element, bool value) => element.SetValue(HiddenElementProperty, value);
|
public static void SetHiddenElement(DependencyObject element, bool value) => element.SetValue(HiddenElementProperty, value);
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register(
|
||||||
"AutoRun", typeof(bool), typeof(Carousel), new PropertyMetadata(BooleanBoxes.FalseBox, (o, args) =>
|
"AutoRun", typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
|
||||||
{
|
{
|
||||||
var ctl = (Carousel)o;
|
var ctl = (Carousel)o;
|
||||||
ctl.TimerSwitch((bool)args.NewValue);
|
ctl.TimerSwitch((bool)args.NewValue);
|
||||||
@@ -90,7 +90,7 @@ namespace HandyControl.Controls
|
|||||||
"Interval", typeof(TimeSpan), typeof(Carousel), new PropertyMetadata(TimeSpan.FromSeconds(2)));
|
"Interval", typeof(TimeSpan), typeof(Carousel), new PropertyMetadata(TimeSpan.FromSeconds(2)));
|
||||||
|
|
||||||
public static readonly DependencyProperty ExtendWidthProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ExtendWidthProperty = DependencyProperty.Register(
|
||||||
"ExtendWidth", typeof(double), typeof(Carousel), new PropertyMetadata(default(double)));
|
"ExtendWidth", typeof(double), typeof(Carousel), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||||
|
|
||||||
public double ExtendWidth
|
public double ExtendWidth
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty IsCenterProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsCenterProperty = DependencyProperty.Register(
|
||||||
"IsCenter", typeof(bool), typeof(Carousel), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsCenter", typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool IsCenter
|
public bool IsCenter
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
{
|
{
|
||||||
@@ -17,7 +18,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty KeepVerticalProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty KeepVerticalProperty = DependencyProperty.Register(
|
||||||
"KeepVertical", typeof(bool), typeof(CirclePanel), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsMeasure));
|
"KeepVertical", typeof(bool), typeof(CirclePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||||
|
|
||||||
public bool KeepVertical
|
public bool KeepVertical
|
||||||
{
|
{
|
||||||
@@ -26,7 +27,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty OffsetAngleProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty OffsetAngleProperty = DependencyProperty.Register(
|
||||||
"OffsetAngle", typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.AffectsMeasure));
|
"OffsetAngle", typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||||
|
|
||||||
public double OffsetAngle
|
public double OffsetAngle
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,18 +11,18 @@ namespace HandyControl.Controls
|
|||||||
private const string IndicatorTemplateName = "PART_Indicator";
|
private const string IndicatorTemplateName = "PART_Indicator";
|
||||||
|
|
||||||
public static readonly DependencyProperty ArcThicknessProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ArcThicknessProperty = DependencyProperty.Register(
|
||||||
"ArcThickness", typeof(double), typeof(CircleProgressBar), new PropertyMetadata(default(double)));
|
"ArcThickness", typeof(double), typeof(CircleProgressBar), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register(
|
||||||
"ShowText", typeof(bool), typeof(CircleProgressBar), new PropertyMetadata(BooleanBoxes.TrueBox));
|
"ShowText", typeof(bool), typeof(CircleProgressBar), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
private Arc _indicator;
|
private Arc _indicator;
|
||||||
|
|
||||||
static CircleProgressBar()
|
static CircleProgressBar()
|
||||||
{
|
{
|
||||||
FocusableProperty.OverrideMetadata(typeof(CircleProgressBar),
|
FocusableProperty.OverrideMetadata(typeof(CircleProgressBar),
|
||||||
new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
|
new FrameworkPropertyMetadata(ValueBoxes.FalseBox));
|
||||||
MaximumProperty.OverrideMetadata(typeof(CircleProgressBar), new FrameworkPropertyMetadata(100.0));
|
MaximumProperty.OverrideMetadata(typeof(CircleProgressBar), new PropertyMetadata(ValueBoxes.Double100Box));
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShowText
|
public bool ShowText
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal static readonly DependencyProperty ShowConfirmButtonProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ShowConfirmButtonProperty = DependencyProperty.Register(
|
||||||
"ShowConfirmButton", typeof(bool), typeof(Clock), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowConfirmButton", typeof(bool), typeof(Clock), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
internal bool ShowConfirmButton
|
internal bool ShowConfirmButton
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace HandyControl.Controls
|
|||||||
"ConfirmStr", typeof(string), typeof(Growl), new PropertyMetadata(default(string)));
|
"ConfirmStr", typeof(string), typeof(Growl), new PropertyMetadata(default(string)));
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowDateTimeProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowDateTimeProperty = DependencyProperty.Register(
|
||||||
"ShowDateTime", typeof(bool), typeof(Growl), new PropertyMetadata(BooleanBoxes.TrueBox));
|
"ShowDateTime", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(
|
||||||
"Message", typeof(string), typeof(Growl), new PropertyMetadata(default(string)));
|
"Message", typeof(string), typeof(Growl), new PropertyMetadata(default(string)));
|
||||||
@@ -121,7 +121,7 @@ namespace HandyControl.Controls
|
|||||||
"Type", typeof(InfoType), typeof(Growl), new PropertyMetadata(default(InfoType)));
|
"Type", typeof(InfoType), typeof(Growl), new PropertyMetadata(default(InfoType)));
|
||||||
|
|
||||||
public static readonly DependencyProperty GrowlParentProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty GrowlParentProperty = DependencyProperty.RegisterAttached(
|
||||||
"GrowlParent", typeof(bool), typeof(Growl), new PropertyMetadata(BooleanBoxes.FalseBox, (o, args) =>
|
"GrowlParent", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
|
||||||
{
|
{
|
||||||
if (o is Panel panel)
|
if (o is Panel panel)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ namespace HandyControl.Controls
|
|||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowImgMapProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowImgMapProperty = DependencyProperty.Register(
|
||||||
"ShowImgMap", typeof(bool), typeof(ImageViewer), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowImgMap", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register(
|
||||||
"ImageSource", typeof(BitmapFrame), typeof(ImageViewer), new PropertyMetadata(default(BitmapFrame)));
|
"ImageSource", typeof(BitmapFrame), typeof(ImageViewer), new PropertyMetadata(default(BitmapFrame)));
|
||||||
@@ -228,13 +228,13 @@ namespace HandyControl.Controls
|
|||||||
/// 是否显示全屏按钮
|
/// 是否显示全屏按钮
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static readonly DependencyProperty ShowFullScreenButtonProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ShowFullScreenButtonProperty = DependencyProperty.Register(
|
||||||
"ShowFullScreenButton", typeof(bool), typeof(ImageViewer), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowFullScreenButton", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关闭按钮是否显示中
|
/// 关闭按钮是否显示中
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register(
|
||||||
"ShowCloseButton", typeof(bool), typeof(ImageViewer), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowCloseButton", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
internal static readonly DependencyProperty ImageContentProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ImageContentProperty = DependencyProperty.Register(
|
||||||
"ImageContent", typeof(object), typeof(ImageViewer), new PropertyMetadata(default(object)));
|
"ImageContent", typeof(object), typeof(ImageViewer), new PropertyMetadata(default(object)));
|
||||||
@@ -243,22 +243,22 @@ namespace HandyControl.Controls
|
|||||||
"ImageMargin", typeof(Thickness), typeof(ImageViewer), new PropertyMetadata(default(Thickness)));
|
"ImageMargin", typeof(Thickness), typeof(ImageViewer), new PropertyMetadata(default(Thickness)));
|
||||||
|
|
||||||
internal static readonly DependencyProperty ImageWidthProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ImageWidthProperty = DependencyProperty.Register(
|
||||||
"ImageWidth", typeof(double), typeof(ImageViewer), new PropertyMetadata(default(double)));
|
"ImageWidth", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||||
|
|
||||||
internal static readonly DependencyProperty ImageHeightProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ImageHeightProperty = DependencyProperty.Register(
|
||||||
"ImageHeight", typeof(double), typeof(ImageViewer), new PropertyMetadata(default(double)));
|
"ImageHeight", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||||
|
|
||||||
internal static readonly DependencyProperty ImageScaleProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ImageScaleProperty = DependencyProperty.Register(
|
||||||
"ImageScale", typeof(double), typeof(ImageViewer), new PropertyMetadata(1.0, OnImageScaleChanged));
|
"ImageScale", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double1Box, OnImageScaleChanged));
|
||||||
|
|
||||||
internal static readonly DependencyProperty ScaleStrProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ScaleStrProperty = DependencyProperty.Register(
|
||||||
"ScaleStr", typeof(string), typeof(ImageViewer), new PropertyMetadata("100%"));
|
"ScaleStr", typeof(string), typeof(ImageViewer), new PropertyMetadata("100%"));
|
||||||
|
|
||||||
internal static readonly DependencyProperty ImageRotateProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ImageRotateProperty = DependencyProperty.Register(
|
||||||
"ImageRotate", typeof(double), typeof(ImageViewer), new PropertyMetadata(default(double)));
|
"ImageRotate", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||||
|
|
||||||
internal static readonly DependencyProperty ShowSmallImgInternalProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ShowSmallImgInternalProperty = DependencyProperty.Register(
|
||||||
"ShowSmallImgInternal", typeof(bool), typeof(ImageViewer), new PropertyMetadata(false));
|
"ShowSmallImgInternal", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool ShowImgMap
|
public bool ShowImgMap
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ namespace HandyControl.Controls
|
|||||||
/// 指示每单击一下按钮时增加或减少的数量
|
/// 指示每单击一下按钮时增加或减少的数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IncrementProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IncrementProperty = DependencyProperty.Register(
|
||||||
"Increment", typeof(double), typeof(NumericUpDown), new PropertyMetadata(1.0));
|
"Increment", typeof(double), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.Double1Box));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 指示每单击一下按钮时增加或减少的数量
|
/// 指示每单击一下按钮时增加或减少的数量
|
||||||
@@ -301,7 +301,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否显示上下调值按钮
|
/// 是否显示上下调值按钮
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static readonly DependencyProperty ShowUpDownButtonProperty = DependencyProperty.Register(
|
internal static readonly DependencyProperty ShowUpDownButtonProperty = DependencyProperty.Register(
|
||||||
"ShowUpDownButton", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(BooleanBoxes.TrueBox));
|
"ShowUpDownButton", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否显示上下调值按钮
|
/// 是否显示上下调值按钮
|
||||||
@@ -316,7 +316,7 @@ namespace HandyControl.Controls
|
|||||||
/// 数据是否错误
|
/// 数据是否错误
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
|
||||||
"IsError", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsError", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool IsError
|
public bool IsError
|
||||||
{
|
{
|
||||||
@@ -352,7 +352,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否显示清除按钮
|
/// 是否显示清除按钮
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
|
||||||
"ShowClearButton", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowClearButton", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool ShowClearButton
|
public bool ShowClearButton
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace HandyControl.Controls
|
|||||||
/// 数据是否错误
|
/// 数据是否错误
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
|
||||||
"IsError", typeof(bool), typeof(TextBox), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsError", typeof(bool), typeof(TextBox), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool IsError
|
public bool IsError
|
||||||
{
|
{
|
||||||
@@ -68,7 +68,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否显示清除按钮
|
/// 是否显示清除按钮
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
|
||||||
"ShowClearButton", typeof(bool), typeof(TextBox), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowClearButton", typeof(bool), typeof(TextBox), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool ShowClearButton
|
public bool ShowClearButton
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
if (!IsDropDownOpen)
|
if (!IsDropDownOpen)
|
||||||
{
|
{
|
||||||
SetCurrentValue(IsDropDownOpenProperty, BooleanBoxes.TrueBox);
|
SetCurrentValue(IsDropDownOpenProperty, ValueBoxes.TrueBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
_clock?.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
|
_clock?.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
|
||||||
@@ -483,7 +483,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
if (IsDropDownOpen)
|
if (IsDropDownOpen)
|
||||||
{
|
{
|
||||||
SetCurrentValue(IsDropDownOpenProperty, BooleanBoxes.FalseBox);
|
SetCurrentValue(IsDropDownOpenProperty, ValueBoxes.FalseBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_clock.IsKeyboardFocusWithin)
|
if (_clock.IsKeyboardFocusWithin)
|
||||||
@@ -500,7 +500,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
if (IsDropDownOpen)
|
if (IsDropDownOpen)
|
||||||
{
|
{
|
||||||
SetCurrentValue(IsDropDownOpenProperty, BooleanBoxes.FalseBox);
|
SetCurrentValue(IsDropDownOpenProperty, ValueBoxes.FalseBox);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -511,7 +511,7 @@ namespace HandyControl.Controls
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetSelectedTime();
|
SetSelectedTime();
|
||||||
SetCurrentValue(IsDropDownOpenProperty, BooleanBoxes.TrueBox);
|
SetCurrentValue(IsDropDownOpenProperty, ValueBoxes.TrueBox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace HandyControl.Controls
|
|||||||
protected Storyboard Storyboard;
|
protected Storyboard Storyboard;
|
||||||
|
|
||||||
public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register(
|
||||||
"IsRunning", typeof(bool), typeof(LoadingBase), new PropertyMetadata(BooleanBoxes.TrueBox, (o, args) =>
|
"IsRunning", typeof(bool), typeof(LoadingBase), new PropertyMetadata(ValueBoxes.TrueBox, (o, args) =>
|
||||||
{
|
{
|
||||||
var ctl = (LoadingBase) o;
|
var ctl = (LoadingBase) o;
|
||||||
var v = (bool) args.NewValue;
|
var v = (bool) args.NewValue;
|
||||||
@@ -48,7 +48,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
public static readonly DependencyProperty DotBorderThicknessProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty DotBorderThicknessProperty = DependencyProperty.Register(
|
||||||
"DotBorderThickness", typeof(double), typeof(LoadingBase),
|
"DotBorderThickness", typeof(double), typeof(LoadingBase),
|
||||||
new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.AffectsRender));
|
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||||
|
|
||||||
public static readonly DependencyProperty DotDiameterProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty DotDiameterProperty = DependencyProperty.Register(
|
||||||
"DotDiameter", typeof(double), typeof(LoadingBase),
|
"DotDiameter", typeof(double), typeof(LoadingBase),
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否响应鼠标滚轮操作
|
/// 是否响应鼠标滚轮操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty CanMouseWheelProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty CanMouseWheelProperty = DependencyProperty.Register(
|
||||||
"CanMouseWheel", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(BooleanBoxes.TrueBox));
|
"CanMouseWheel", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否响应鼠标滚轮操作
|
/// 是否响应鼠标滚轮操作
|
||||||
@@ -120,7 +120,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否支持惯性
|
/// 是否支持惯性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableInertiaProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty IsEnableInertiaProperty = DependencyProperty.RegisterAttached(
|
||||||
"IsEnableInertia", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsEnableInertia", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public static void SetIsEnableInertia(DependencyObject element, bool value)
|
public static void SetIsEnableInertia(DependencyObject element, bool value)
|
||||||
{
|
{
|
||||||
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
|
|||||||
/// 控件是否可以穿透点击
|
/// 控件是否可以穿透点击
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsPenetratingProperty = DependencyProperty.RegisterAttached(
|
public static readonly DependencyProperty IsPenetratingProperty = DependencyProperty.RegisterAttached(
|
||||||
"IsPenetrating", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsPenetrating", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 控件是否可以穿透点击
|
/// 控件是否可以穿透点击
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty PreviewPositionProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty PreviewPositionProperty = DependencyProperty.Register(
|
||||||
"PreviewPosition", typeof(double), typeof(PreviewSlider), new PropertyMetadata(default(double)));
|
"PreviewPosition", typeof(double), typeof(PreviewSlider), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||||
|
|
||||||
public double PreviewPosition
|
public double PreviewPosition
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否启用动画
|
/// 是否启用动画
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableAnimationProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsEnableAnimationProperty = DependencyProperty.Register(
|
||||||
"IsEnableAnimation", typeof(bool), typeof(TabControl), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsEnableAnimation", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启用动画
|
/// 是否启用动画
|
||||||
@@ -45,7 +45,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否可以拖动
|
/// 是否可以拖动
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsDraggableProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsDraggableProperty = DependencyProperty.Register(
|
||||||
"IsDraggable", typeof(bool), typeof(TabControl), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsDraggable", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否可以拖动
|
/// 是否可以拖动
|
||||||
@@ -60,7 +60,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否显示关闭按钮
|
/// 是否显示关闭按钮
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register(
|
||||||
"ShowCloseButton", typeof(bool), typeof(TabControl), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowCloseButton", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否显示关闭按钮
|
/// 是否显示关闭按钮
|
||||||
@@ -75,7 +75,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
|
||||||
"IsEnableTabFill", typeof(bool), typeof(TabControl), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsEnableTabFill", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
|
||||||
"IsEnableTabFill", typeof(bool), typeof(TabPanel), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"IsEnableTabFill", typeof(bool), typeof(TabPanel), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否将标签填充
|
/// 是否将标签填充
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace HandyControl.Controls
|
|||||||
/// 是否显示刻度字符串
|
/// 是否显示刻度字符串
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty ShowSpeStrProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowSpeStrProperty = DependencyProperty.Register(
|
||||||
"ShowSpeStr", typeof(bool), typeof(TimeBar), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowSpeStr", typeof(bool), typeof(TimeBar), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register(
|
||||||
"TimeFormat", typeof(string), typeof(TimeBar), new PropertyMetadata("yyyy-MM-dd HH:mm:ss"));
|
"TimeFormat", typeof(string), typeof(TimeBar), new PropertyMetadata("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Linq;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
|
using HandyControl.Data;
|
||||||
using HandyControl.Tools;
|
using HandyControl.Tools;
|
||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
@@ -247,7 +248,7 @@ namespace HandyControl.Controls
|
|||||||
"RestartTransitionOnContentChange",
|
"RestartTransitionOnContentChange",
|
||||||
typeof(bool),
|
typeof(bool),
|
||||||
typeof(TransitioningContentControl),
|
typeof(TransitioningContentControl),
|
||||||
new PropertyMetadata(false, OnRestartTransitionOnContentChangePropertyChanged));
|
new PropertyMetadata(ValueBoxes.FalseBox, OnRestartTransitionOnContentChangePropertyChanged));
|
||||||
|
|
||||||
private static void OnRestartTransitionOnContentChangePropertyChanged(DependencyObject d,
|
private static void OnRestartTransitionOnContentChangePropertyChanged(DependencyObject d,
|
||||||
DependencyPropertyChangedEventArgs e)
|
DependencyPropertyChangedEventArgs e)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
static ImageBrowser()
|
static ImageBrowser()
|
||||||
{
|
{
|
||||||
IsFullScreenProperty.AddOwner(typeof(ImageBrowser), new PropertyMetadata(BooleanBoxes.FalseBox));
|
IsFullScreenProperty.AddOwner(typeof(ImageBrowser), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageBrowser()
|
public ImageBrowser()
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace HandyControl.Controls
|
|||||||
public FrameworkElement PopupElement { get; set; }
|
public FrameworkElement PopupElement { get; set; }
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register(
|
||||||
"ShowTitle", typeof(bool), typeof(PopupWindow), new PropertyMetadata(BooleanBoxes.TrueBox));
|
"ShowTitle", typeof(bool), typeof(PopupWindow), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
public bool ShowTitle
|
public bool ShowTitle
|
||||||
{
|
{
|
||||||
@@ -114,7 +114,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowCancelProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowCancelProperty = DependencyProperty.Register(
|
||||||
"ShowCancel", typeof(bool), typeof(PopupWindow), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowCancel", typeof(bool), typeof(PopupWindow), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool ShowCancel
|
public bool ShowCancel
|
||||||
{
|
{
|
||||||
@@ -123,7 +123,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowBorderProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowBorderProperty = DependencyProperty.Register(
|
||||||
"ShowBorder", typeof(bool), typeof(PopupWindow), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowBorder", typeof(bool), typeof(PopupWindow), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public bool ShowBorder
|
public bool ShowBorder
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,13 +60,13 @@ namespace HandyControl.Controls
|
|||||||
new PropertyMetadata(28.0));
|
new PropertyMetadata(28.0));
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowNonClientAreaProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowNonClientAreaProperty = DependencyProperty.Register(
|
||||||
"ShowNonClientArea", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(BooleanBoxes.TrueBox));
|
"ShowNonClientArea", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register(
|
||||||
"ShowTitle", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(BooleanBoxes.FalseBox));
|
"ShowTitle", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register(
|
||||||
"IsFullScreen", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(BooleanBoxes.FalseBox,
|
"IsFullScreen", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(ValueBoxes.FalseBox,
|
||||||
(o, args) =>
|
(o, args) =>
|
||||||
{
|
{
|
||||||
var ctl = (WindowBorderless)o;
|
var ctl = (WindowBorderless)o;
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace HandyControl.Data
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 装箱后的布尔值(用于提高效率)
|
|
||||||
/// </summary>
|
|
||||||
internal static class BooleanBoxes
|
|
||||||
{
|
|
||||||
internal static object TrueBox = true;
|
|
||||||
internal static object FalseBox = false;
|
|
||||||
|
|
||||||
internal static object Box(bool value) => value ? TrueBox : FalseBox;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using HandyControl.Data;
|
|
||||||
|
|
||||||
namespace HandyControl.Data
|
namespace HandyControl.Data
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace HandyControl.Data
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 装箱后的布尔值(用于提高效率)
|
||||||
|
/// </summary>
|
||||||
|
internal static class ValueBoxes
|
||||||
|
{
|
||||||
|
internal static object TrueBox = true;
|
||||||
|
|
||||||
|
internal static object FalseBox = false;
|
||||||
|
|
||||||
|
internal static object Double0Box = .0;
|
||||||
|
|
||||||
|
internal static object Double1Box = 1.0;
|
||||||
|
|
||||||
|
internal static object Double100Box = 100.0;
|
||||||
|
|
||||||
|
internal static object DoubleNeg1Box = -1.0;
|
||||||
|
|
||||||
|
internal static object BooleanBox(bool value) => value ? TrueBox : FalseBox;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
<Compile Include="Controls\Window\ImageBrowser.cs" />
|
<Compile Include="Controls\Window\ImageBrowser.cs" />
|
||||||
<Compile Include="Controls\Window\PopupWindow.cs" />
|
<Compile Include="Controls\Window\PopupWindow.cs" />
|
||||||
<Compile Include="Controls\Window\WindowBorderless.cs" />
|
<Compile Include="Controls\Window\WindowBorderless.cs" />
|
||||||
<Compile Include="Data\BooleanBoxes.cs" />
|
<Compile Include="Data\ValueBoxes.cs" />
|
||||||
<Compile Include="Data\ColorRange.cs" />
|
<Compile Include="Data\ColorRange.cs" />
|
||||||
<Compile Include="Data\Enum\IpType.cs" />
|
<Compile Include="Data\Enum\IpType.cs" />
|
||||||
<Compile Include="Data\Enum\TextType.cs" />
|
<Compile Include="Data\Enum\TextType.cs" />
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
namespace HandyControl.Interactivity
|
namespace HandyControl.Interactivity
|
||||||
{
|
{
|
||||||
@@ -49,7 +50,7 @@ namespace HandyControl.Interactivity
|
|||||||
new PropertyMetadata(null, (s, e) => OnCommandChanged(s as EventToCommand, e)));
|
new PropertyMetadata(null, (s, e) => OnCommandChanged(s as EventToCommand, e)));
|
||||||
|
|
||||||
public static readonly DependencyProperty MustToggleIsEnabledProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty MustToggleIsEnabledProperty = DependencyProperty.Register(
|
||||||
nameof(MustToggleIsEnabled), typeof(bool), typeof(EventToCommand), new PropertyMetadata(false,
|
nameof(MustToggleIsEnabled), typeof(bool), typeof(EventToCommand), new PropertyMetadata(ValueBoxes.FalseBox,
|
||||||
(s, e) =>
|
(s, e) =>
|
||||||
{
|
{
|
||||||
var eventToCommand = s as EventToCommand;
|
var eventToCommand = s as EventToCommand;
|
||||||
@@ -64,7 +65,7 @@ namespace HandyControl.Interactivity
|
|||||||
|
|
||||||
public static readonly DependencyProperty AlwaysInvokeCommandProperty =
|
public static readonly DependencyProperty AlwaysInvokeCommandProperty =
|
||||||
DependencyProperty.Register(nameof(AlwaysInvokeCommand), typeof(bool), typeof(EventToCommand),
|
DependencyProperty.Register(nameof(AlwaysInvokeCommand), typeof(bool), typeof(EventToCommand),
|
||||||
new PropertyMetadata(false));
|
new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
private object _commandParameterValue;
|
private object _commandParameterValue;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Media.Effects;
|
using System.Windows.Media.Effects;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
namespace HandyControl.Interactivity
|
namespace HandyControl.Interactivity
|
||||||
{
|
{
|
||||||
@@ -30,7 +31,7 @@ namespace HandyControl.Interactivity
|
|||||||
|
|
||||||
internal static readonly DependencyProperty DidCacheBackgroundProperty =
|
internal static readonly DependencyProperty DidCacheBackgroundProperty =
|
||||||
DependencyProperty.RegisterAttached("DidCacheBackground", typeof(bool), typeof(ExtendedVisualStateManager),
|
DependencyProperty.RegisterAttached("DidCacheBackground", typeof(bool), typeof(ExtendedVisualStateManager),
|
||||||
new PropertyMetadata(false));
|
new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
private static readonly List<DependencyProperty> LayoutProperties;
|
private static readonly List<DependencyProperty> LayoutProperties;
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ namespace HandyControl.Interactivity
|
|||||||
|
|
||||||
public static readonly DependencyProperty UseFluidLayoutProperty =
|
public static readonly DependencyProperty UseFluidLayoutProperty =
|
||||||
DependencyProperty.RegisterAttached("UseFluidLayout", typeof(bool), typeof(ExtendedVisualStateManager),
|
DependencyProperty.RegisterAttached("UseFluidLayout", typeof(bool), typeof(ExtendedVisualStateManager),
|
||||||
new PropertyMetadata(false));
|
new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
private bool _changingState;
|
private bool _changingState;
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ namespace HandyControl.Interactivity
|
|||||||
|
|
||||||
public static readonly DependencyProperty FloatAboveProperty =
|
public static readonly DependencyProperty FloatAboveProperty =
|
||||||
DependencyProperty.Register("FloatAbove", typeof(bool), typeof(FluidMoveBehavior),
|
DependencyProperty.Register("FloatAbove", typeof(bool), typeof(FluidMoveBehavior),
|
||||||
new PropertyMetadata(BooleanBoxes.TrueBox));
|
new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
private static readonly DependencyProperty HasTransformWrapperProperty =
|
private static readonly DependencyProperty HasTransformWrapperProperty =
|
||||||
DependencyProperty.RegisterAttached("HasTransformWrapper", typeof(bool),
|
DependencyProperty.RegisterAttached("HasTransformWrapper", typeof(bool),
|
||||||
typeof(FluidMoveBehavior), new PropertyMetadata(false));
|
typeof(FluidMoveBehavior), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
private static readonly DependencyProperty InitialIdentityTagProperty =
|
private static readonly DependencyProperty InitialIdentityTagProperty =
|
||||||
DependencyProperty.RegisterAttached("InitialIdentityTag", typeof(object),
|
DependencyProperty.RegisterAttached("InitialIdentityTag", typeof(object),
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace HandyControl.Interactivity
|
|||||||
new PropertyMetadata(null));
|
new PropertyMetadata(null));
|
||||||
|
|
||||||
public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register("IsActive",
|
public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register("IsActive",
|
||||||
typeof(bool), typeof(FluidMoveBehaviorBase), new PropertyMetadata(BooleanBoxes.TrueBox));
|
typeof(bool), typeof(FluidMoveBehaviorBase), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||||
|
|
||||||
private static DateTime LastPurgeTick = DateTime.MinValue;
|
private static DateTime LastPurgeTick = DateTime.MinValue;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
namespace HandyControl.Interactivity
|
namespace HandyControl.Interactivity
|
||||||
{
|
{
|
||||||
@@ -8,13 +9,13 @@ namespace HandyControl.Interactivity
|
|||||||
{
|
{
|
||||||
public static readonly DependencyProperty ConstrainToParentBoundsProperty =
|
public static readonly DependencyProperty ConstrainToParentBoundsProperty =
|
||||||
DependencyProperty.Register("ConstrainToParentBounds", typeof(bool), typeof(MouseDragElementBehavior),
|
DependencyProperty.Register("ConstrainToParentBounds", typeof(bool), typeof(MouseDragElementBehavior),
|
||||||
new PropertyMetadata(false, OnConstrainToParentBoundsChanged));
|
new PropertyMetadata(ValueBoxes.FalseBox, OnConstrainToParentBoundsChanged));
|
||||||
|
|
||||||
public static readonly DependencyProperty XProperty = DependencyProperty.Register("X", typeof(double),
|
public static readonly DependencyProperty XProperty = DependencyProperty.Register("X", typeof(double),
|
||||||
typeof(MouseDragElementBehavior), new PropertyMetadata(1.0 / 0.0, OnXChanged));
|
typeof(MouseDragElementBehavior), new PropertyMetadata(double.PositiveInfinity, OnXChanged));
|
||||||
|
|
||||||
public static readonly DependencyProperty YProperty = DependencyProperty.Register("Y", typeof(double),
|
public static readonly DependencyProperty YProperty = DependencyProperty.Register("Y", typeof(double),
|
||||||
typeof(MouseDragElementBehavior), new PropertyMetadata(1.0 / 0.0, OnYChanged));
|
typeof(MouseDragElementBehavior), new PropertyMetadata(double.PositiveInfinity, OnYChanged));
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
private Transform _cachedRenderTransform;
|
private Transform _cachedRenderTransform;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using HandyControl.Data;
|
||||||
using HandyControl.Interactivity;
|
using HandyControl.Interactivity;
|
||||||
|
|
||||||
namespace HandyControl.Tools
|
namespace HandyControl.Tools
|
||||||
@@ -18,7 +19,7 @@ namespace HandyControl.Tools
|
|||||||
|
|
||||||
public static readonly DependencyProperty ConstrainToParentBoundsProperty =
|
public static readonly DependencyProperty ConstrainToParentBoundsProperty =
|
||||||
DependencyProperty.Register(nameof(ConstrainToParentBounds), typeof(bool),
|
DependencyProperty.Register(nameof(ConstrainToParentBounds), typeof(bool),
|
||||||
typeof(MouseDragElementBehaviorEx), new PropertyMetadata(false, OnConstrainToParentBoundsChanged));
|
typeof(MouseDragElementBehaviorEx), new PropertyMetadata(ValueBoxes.FalseBox, OnConstrainToParentBoundsChanged));
|
||||||
|
|
||||||
private Transform _cachedRenderTransform;
|
private Transform _cachedRenderTransform;
|
||||||
private Point _relativePosition;
|
private Point _relativePosition;
|
||||||
|
|||||||
Reference in new issue
Block a user