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

@@ -67,7 +67,7 @@ namespace HandyControl.Controls
public bool IsSelected public bool IsSelected
{ {
get => (bool)GetValue(IsSelectedProperty); get => (bool)GetValue(IsSelectedProperty);
set => SetValue(IsSelectedProperty, value); set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty SelfManageProperty = DependencyProperty.Register( public static readonly DependencyProperty SelfManageProperty = DependencyProperty.Register(
@@ -76,7 +76,7 @@ namespace HandyControl.Controls
public bool SelfManage public bool SelfManage
{ {
get => (bool) GetValue(SelfManageProperty); get => (bool) GetValue(SelfManageProperty);
set => SetValue(SelfManageProperty, value); set => SetValue(SelfManageProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty CanDeselectProperty = DependencyProperty.Register( public static readonly DependencyProperty CanDeselectProperty = DependencyProperty.Register(
@@ -85,7 +85,7 @@ namespace HandyControl.Controls
public bool CanDeselect public bool CanDeselect
{ {
get => (bool) GetValue(CanDeselectProperty); get => (bool) GetValue(CanDeselectProperty);
set => SetValue(CanDeselectProperty, value); set => SetValue(CanDeselectProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly RoutedEvent SelectedEvent = public static readonly RoutedEvent SelectedEvent =
@@ -38,7 +38,7 @@ namespace HandyControl.Controls
{ {
if (e.NewItems != null && e.NewItems.Count > 0) if (e.NewItems != null && e.NewItems.Count > 0)
{ {
SetValue(HasItemsPropertyKey, true); SetValue(HasItemsPropertyKey, ValueBoxes.TrueBox);
} }
OnItemsChanged(s, e); OnItemsChanged(s, e);
}; };
@@ -36,7 +36,7 @@ namespace HandyControl.Controls
public bool Runaway public bool Runaway
{ {
get => (bool) GetValue(RunawayProperty); get => (bool) GetValue(RunawayProperty);
set => SetValue(RunawayProperty, value); set => SetValue(RunawayProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register(
@@ -45,7 +45,7 @@ namespace HandyControl.Controls
public bool AutoRun public bool AutoRun
{ {
get => (bool) GetValue(AutoRunProperty); get => (bool) GetValue(AutoRunProperty);
set => SetValue(AutoRunProperty, value); set => SetValue(AutoRunProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
@@ -93,7 +93,7 @@ namespace HandyControl.Controls
public bool IsRunning public bool IsRunning
{ {
get => (bool) GetValue(IsRunningProperty); get => (bool) GetValue(IsRunningProperty);
set => SetValue(IsRunningProperty, value); set => SetValue(IsRunningProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty AutoReverseProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoReverseProperty = DependencyProperty.Register(
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
public bool AutoReverse public bool AutoReverse
{ {
get => (bool) GetValue(AutoReverseProperty); get => (bool) GetValue(AutoReverseProperty);
set => SetValue(AutoReverseProperty, value); set => SetValue(AutoReverseProperty, ValueBoxes.BooleanBox(value));
} }
private void UpdateContent() private void UpdateContent()
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
public bool IsDropDownOpen public bool IsDropDownOpen
{ {
get => (bool) GetValue(IsDropDownOpenProperty); get => (bool) GetValue(IsDropDownOpenProperty);
set => SetValue(IsDropDownOpenProperty, value); set => SetValue(IsDropDownOpenProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty DropDownContentProperty = DependencyProperty.Register( public static readonly DependencyProperty DropDownContentProperty = DependencyProperty.Register(
@@ -104,7 +104,7 @@ namespace HandyControl.Controls
public bool IsCenter public bool IsCenter
{ {
get => (bool)GetValue(IsCenterProperty); get => (bool)GetValue(IsCenterProperty);
set => SetValue(IsCenterProperty, value); set => SetValue(IsCenterProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty PageButtonStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty PageButtonStyleProperty = DependencyProperty.Register(
@@ -161,7 +161,7 @@ namespace HandyControl.Controls
public bool AutoRun public bool AutoRun
{ {
get => (bool)GetValue(AutoRunProperty); get => (bool)GetValue(AutoRunProperty);
set => SetValue(AutoRunProperty, value); set => SetValue(AutoRunProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -123,7 +123,7 @@ namespace HandyControl.Controls
public bool Loop public bool Loop
{ {
get => (bool)GetValue(LoopProperty); get => (bool)GetValue(LoopProperty);
set => SetValue(LoopProperty, value); set => SetValue(LoopProperty, ValueBoxes.BooleanBox(value));
} }
public override void OnApplyTemplate() public override void OnApplyTemplate()
@@ -146,7 +146,7 @@ namespace HandyControl.Controls
public bool ItemContentHeightFixed public bool ItemContentHeightFixed
{ {
get => (bool)GetValue(ItemContentHeightFixedProperty); get => (bool)GetValue(ItemContentHeightFixedProperty);
set => SetValue(ItemContentHeightFixedProperty, value); set => SetValue(ItemContentHeightFixedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ItemHeaderTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemHeaderTemplateProperty = DependencyProperty.Register(
@@ -24,7 +24,7 @@ namespace HandyControl.Controls
public bool IsClosed public bool IsClosed
{ {
get => (bool)GetValue(IsClosedProperty); get => (bool)GetValue(IsClosedProperty);
internal set => SetValue(IsClosedProperty, value); internal set => SetValue(IsClosedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty TokenProperty = DependencyProperty.RegisterAttached( public static readonly DependencyProperty TokenProperty = DependencyProperty.RegisterAttached(
@@ -234,7 +234,7 @@ namespace HandyControl.Controls
public bool ShowDateTime public bool ShowDateTime
{ {
get => (bool)GetValue(ShowDateTimeProperty); get => (bool)GetValue(ShowDateTimeProperty);
set => SetValue(ShowDateTimeProperty, value); set => SetValue(ShowDateTimeProperty, ValueBoxes.BooleanBox(value));
} }
public string Message public string Message
@@ -143,7 +143,7 @@ namespace HandyControl.Controls
public bool IsPlaying public bool IsPlaying
{ {
get => (bool) GetValue(IsPlayingProperty); get => (bool) GetValue(IsPlayingProperty);
set => SetValue(IsPlayingProperty, value); set => SetValue(IsPlayingProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register( public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register(
@@ -271,13 +271,13 @@ namespace HandyControl.Controls
public bool IsFullScreen public bool IsFullScreen
{ {
get => (bool)GetValue(IsFullScreenProperty); get => (bool)GetValue(IsFullScreenProperty);
set => SetValue(IsFullScreenProperty, value); set => SetValue(IsFullScreenProperty, ValueBoxes.BooleanBox(value));
} }
public bool ShowImgMap public bool ShowImgMap
{ {
get => (bool)GetValue(ShowImgMapProperty); get => (bool)GetValue(ShowImgMapProperty);
set => SetValue(ShowImgMapProperty, value); set => SetValue(ShowImgMapProperty, ValueBoxes.BooleanBox(value));
} }
public BitmapFrame ImageSource public BitmapFrame ImageSource
@@ -310,7 +310,7 @@ namespace HandyControl.Controls
internal bool ShowFullScreenButton internal bool ShowFullScreenButton
{ {
get => (bool)GetValue(ShowFullScreenButtonProperty); get => (bool)GetValue(ShowFullScreenButtonProperty);
set => SetValue(ShowFullScreenButtonProperty, value); set => SetValue(ShowFullScreenButtonProperty, ValueBoxes.BooleanBox(value));
} }
internal Thickness ImageMargin internal Thickness ImageMargin
@@ -352,7 +352,7 @@ namespace HandyControl.Controls
internal bool ShowSmallImgInternal internal bool ShowSmallImgInternal
{ {
get => (bool)GetValue(ShowSmallImgInternalProperty); get => (bool)GetValue(ShowSmallImgInternalProperty);
set => SetValue(ShowSmallImgInternalProperty, value); set => SetValue(ShowSmallImgInternalProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -371,7 +371,7 @@ namespace HandyControl.Controls
internal bool ShowCloseButton internal bool ShowCloseButton
{ {
get => (bool)GetValue(ShowCloseButtonProperty); get => (bool)GetValue(ShowCloseButtonProperty);
set => SetValue(ShowCloseButtonProperty, value); set => SetValue(ShowCloseButtonProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -169,7 +169,7 @@ namespace HandyControl.Controls
public bool IsError public bool IsError
{ {
get => (bool)GetValue(IsErrorProperty); get => (bool)GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, value); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -220,7 +220,7 @@ namespace HandyControl.Controls
public bool ShowClearButton public bool ShowClearButton
{ {
get => (bool)GetValue(ShowClearButtonProperty); get => (bool)GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, value); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -339,7 +339,7 @@ namespace HandyControl.Controls
public bool AutoComplete public bool AutoComplete
{ {
get => (bool)GetValue(AutoCompleteProperty); get => (bool)GetValue(AutoCompleteProperty);
set => SetValue(AutoCompleteProperty, value); set => SetValue(AutoCompleteProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -51,7 +51,7 @@ namespace HandyControl.Controls
public bool IsError public bool IsError
{ {
get => (bool) GetValue(IsErrorProperty); get => (bool) GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, value); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
@@ -78,7 +78,7 @@ namespace HandyControl.Controls
public bool ShowClearButton public bool ShowClearButton
{ {
get => (bool) GetValue(ShowClearButtonProperty); get => (bool) GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, value); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
} }
public virtual bool VerifyData() public virtual bool VerifyData()
@@ -153,7 +153,7 @@ namespace HandyControl.Controls
public bool IsDropDownOpen public bool IsDropDownOpen
{ {
get => (bool) GetValue(IsDropDownOpenProperty); get => (bool) GetValue(IsDropDownOpenProperty);
set => SetValue(IsDropDownOpenProperty, value); set => SetValue(IsDropDownOpenProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register(
@@ -238,7 +238,7 @@ namespace HandyControl.Controls
public bool IsError public bool IsError
{ {
get => (bool) GetValue(IsErrorProperty); get => (bool) GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, value); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
@@ -265,7 +265,7 @@ namespace HandyControl.Controls
public bool ShowClearButton public bool ShowClearButton
{ {
get => (bool) GetValue(ShowClearButtonProperty); get => (bool) GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, value); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
} }
#endregion #endregion
@@ -120,7 +120,7 @@ namespace HandyControl.Controls
public bool HasValue public bool HasValue
{ {
get => (bool) GetValue(HasValueProperty); get => (bool) GetValue(HasValueProperty);
set => SetValue(HasValueProperty, value); set => SetValue(HasValueProperty, ValueBoxes.BooleanBox(value));
} }
} }
} }
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
internal bool ShowUpDownButton internal bool ShowUpDownButton
{ {
get => (bool)GetValue(ShowUpDownButtonProperty); get => (bool)GetValue(ShowUpDownButtonProperty);
set => SetValue(ShowUpDownButtonProperty, value); set => SetValue(ShowUpDownButtonProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -333,7 +333,7 @@ namespace HandyControl.Controls
public bool IsError public bool IsError
{ {
get => (bool)GetValue(IsErrorProperty); get => (bool)GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, value); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -372,7 +372,7 @@ namespace HandyControl.Controls
public bool ShowClearButton public bool ShowClearButton
{ {
get => (bool)GetValue(ShowClearButtonProperty); get => (bool)GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, value); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -387,7 +387,7 @@ namespace HandyControl.Controls
public bool IsReadOnly public bool IsReadOnly
{ {
get => (bool)GetValue(IsReadOnlyProperty); get => (bool)GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, value); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
} }
public Func<string, OperationResult<bool>> VerifyFunc { get; set; } public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
@@ -20,6 +20,11 @@ namespace HandyControl.Controls
private const string ElementTextBox = "PART_TextBox"; private const string ElementTextBox = "PART_TextBox";
private SecureString _password;
private System.Windows.Controls.TextBox _textBox;
/// <summary> /// <summary>
/// 掩码字符 /// 掩码字符
/// </summary> /// </summary>
@@ -27,46 +32,81 @@ namespace HandyControl.Controls
System.Windows.Controls.PasswordBox.PasswordCharProperty.AddOwner(typeof(PasswordBox), System.Windows.Controls.PasswordBox.PasswordCharProperty.AddOwner(typeof(PasswordBox),
new FrameworkPropertyMetadata('●')); new FrameworkPropertyMetadata('●'));
public char PasswordChar
{
get => (char)GetValue(PasswordCharProperty);
set => SetValue(PasswordCharProperty, value);
}
/// <summary> /// <summary>
/// 数据是否错误 /// 数据是否错误
/// </summary> /// </summary>
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register( public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
"IsError", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox)); "IsError", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsError
{
get => (bool)GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
}
/// <summary> /// <summary>
/// 错误提示 /// 错误提示
/// </summary> /// </summary>
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
"ErrorStr", typeof(string), typeof(PasswordBox), new PropertyMetadata(default(string))); "ErrorStr", typeof(string), typeof(PasswordBox), new PropertyMetadata(default(string)));
public string ErrorStr
{
get => (string)GetValue(ErrorStrProperty);
set => SetValue(ErrorStrProperty, value);
}
/// <summary> /// <summary>
/// 文本类型 /// 文本类型
/// </summary> /// </summary>
public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register(
"TextType", typeof(TextType), typeof(PasswordBox), new PropertyMetadata(default(TextType))); "TextType", typeof(TextType), typeof(PasswordBox), new PropertyMetadata(default(TextType)));
public TextType TextType
{
get => (TextType)GetValue(TextTypeProperty);
set => SetValue(TextTypeProperty, value);
}
/// <summary> /// <summary>
/// 是否显示清除按钮 /// 是否显示清除按钮
/// </summary> /// </summary>
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
"ShowClearButton", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox)); "ShowClearButton", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowClearButton
{
get => (bool)GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
}
public static readonly DependencyProperty ShowEyeButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowEyeButtonProperty = DependencyProperty.Register(
"ShowEyeButton", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox)); "ShowEyeButton", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowEyeButton
{
get => (bool)GetValue(ShowEyeButtonProperty);
set => SetValue(ShowEyeButtonProperty, ValueBoxes.BooleanBox(value));
}
public static readonly DependencyProperty ShowPasswordProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowPasswordProperty = DependencyProperty.Register(
"ShowPassword", typeof(bool), typeof(PasswordBox), "ShowPassword", typeof(bool), typeof(PasswordBox),
new PropertyMetadata(ValueBoxes.FalseBox, OnShowPasswordChanged)); new PropertyMetadata(ValueBoxes.FalseBox, OnShowPasswordChanged));
private SecureString _password; public bool ShowPassword
private System.Windows.Controls.TextBox _textBox;
public PasswordBox()
{ {
CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) => Clear())); get => (bool)GetValue(ShowPasswordProperty);
set => SetValue(ShowPasswordProperty, ValueBoxes.BooleanBox(value));
} }
public PasswordBox() => CommandBindings.Add(new CommandBinding(ControlCommands.Clear, (s, e) => Clear()));
public System.Windows.Controls.PasswordBox ActualPasswordBox { get; set; } public System.Windows.Controls.PasswordBox ActualPasswordBox { get; set; }
[DefaultValue("")] [DefaultValue("")]
@@ -101,50 +141,8 @@ namespace HandyControl.Controls
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public SecureString SecurePassword => ActualPasswordBox?.SecurePassword; public SecureString SecurePassword => ActualPasswordBox?.SecurePassword;
public char PasswordChar
{
get => (char) GetValue(PasswordCharProperty);
set => SetValue(PasswordCharProperty, value);
}
public bool ShowEyeButton
{
get => (bool) GetValue(ShowEyeButtonProperty);
set => SetValue(ShowEyeButtonProperty, value);
}
public bool ShowPassword
{
get => (bool) GetValue(ShowPasswordProperty);
set => SetValue(ShowPasswordProperty, value);
}
public Func<string, OperationResult<bool>> VerifyFunc { get; set; } public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
public bool IsError
{
get => (bool) GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, value);
}
public string ErrorStr
{
get => (string) GetValue(ErrorStrProperty);
set => SetValue(ErrorStrProperty, value);
}
public TextType TextType
{
get => (TextType) GetValue(TextTypeProperty);
set => SetValue(TextTypeProperty, value);
}
public bool ShowClearButton
{
get => (bool) GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, value);
}
public virtual bool VerifyData() public virtual bool VerifyData()
{ {
OperationResult<bool> result; OperationResult<bool> result;
@@ -77,7 +77,7 @@ namespace HandyControl.Controls
public bool IsRealTime public bool IsRealTime
{ {
get => (bool)GetValue(IsRealTimeProperty); get => (bool)GetValue(IsRealTimeProperty);
set => SetValue(IsRealTimeProperty, value); set => SetValue(IsRealTimeProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register( public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
@@ -36,7 +36,7 @@ namespace HandyControl.Controls
public bool IsError public bool IsError
{ {
get => (bool) GetValue(IsErrorProperty); get => (bool) GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, value); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -72,7 +72,7 @@ namespace HandyControl.Controls
public bool ShowClearButton public bool ShowClearButton
{ {
get => (bool) GetValue(ShowClearButtonProperty); get => (bool) GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, value); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
} }
public virtual bool VerifyData() public virtual bool VerifyData()
@@ -130,7 +130,7 @@ namespace HandyControl.Controls
public bool IsDropDownOpen public bool IsDropDownOpen
{ {
get => (bool)GetValue(IsDropDownOpenProperty); get => (bool)GetValue(IsDropDownOpenProperty);
set => SetValue(IsDropDownOpenProperty, value); set => SetValue(IsDropDownOpenProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty IsDropDownOpenProperty = public static readonly DependencyProperty IsDropDownOpenProperty =
@@ -262,7 +262,7 @@ namespace HandyControl.Controls
public bool IsError public bool IsError
{ {
get => (bool)GetValue(IsErrorProperty); get => (bool)GetValue(IsErrorProperty);
set => SetValue(IsErrorProperty, value); set => SetValue(IsErrorProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
@@ -289,7 +289,7 @@ namespace HandyControl.Controls
public bool ShowClearButton public bool ShowClearButton
{ {
get => (bool)GetValue(ShowClearButtonProperty); get => (bool)GetValue(ShowClearButtonProperty);
set => SetValue(ShowClearButtonProperty, value); set => SetValue(ShowClearButtonProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ClockProperty = DependencyProperty.Register( public static readonly DependencyProperty ClockProperty = DependencyProperty.Register(
@@ -31,7 +31,7 @@ namespace HandyControl.Controls
public bool IsRunning public bool IsRunning
{ {
get => (bool) GetValue(IsRunningProperty); get => (bool) GetValue(IsRunningProperty);
set => SetValue(IsRunningProperty, value); set => SetValue(IsRunningProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty DotCountProperty = DependencyProperty.Register( public static readonly DependencyProperty DotCountProperty = DependencyProperty.Register(
@@ -4,6 +4,7 @@ using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using HandyControl.Data;
namespace HandyControl.Controls namespace HandyControl.Controls
@@ -27,7 +28,7 @@ namespace HandyControl.Controls
public bool NeedHidden public bool NeedHidden
{ {
get => (bool) GetValue(NeedHiddenProperty); get => (bool) GetValue(NeedHiddenProperty);
set => SetValue(NeedHiddenProperty, value); set => SetValue(NeedHiddenProperty, ValueBoxes.BooleanBox(value));
} }
static LoadingCircle() static LoadingCircle()
@@ -100,7 +100,7 @@ namespace HandyControl.Controls
public bool IsPlaying public bool IsPlaying
{ {
get => (bool)GetValue(IsPlayingProperty); get => (bool)GetValue(IsPlayingProperty);
set => SetValue(IsPlayingProperty, value); set => SetValue(IsPlayingProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty RepeatBehaviorProperty = DependencyProperty.Register( public static readonly DependencyProperty RepeatBehaviorProperty = DependencyProperty.Register(
@@ -86,7 +86,7 @@ namespace HandyControl.Controls
public bool ShowBadge public bool ShowBadge
{ {
get => (bool) GetValue(ShowBadgeProperty); get => (bool) GetValue(ShowBadgeProperty);
set => SetValue(ShowBadgeProperty, value); set => SetValue(ShowBadgeProperty, ValueBoxes.BooleanBox(value));
} }
protected override Geometry GetLayoutClip(Size layoutSlotSize) => null; protected override Geometry GetLayoutClip(Size layoutSlotSize) => null;
@@ -30,7 +30,7 @@ namespace HandyControl.Controls
public bool IsRead public bool IsRead
{ {
get => (bool) GetValue(IsReadProperty); get => (bool) GetValue(IsReadProperty);
set => SetValue(IsReadProperty, value); set => SetValue(IsReadProperty, ValueBoxes.BooleanBox(value));
} }
public static void SetMaxWidth(DependencyObject element, double value) public static void SetMaxWidth(DependencyObject element, double value)
@@ -109,7 +109,7 @@ namespace HandyControl.Controls
public bool IsOpen public bool IsOpen
{ {
get => (bool) GetValue(IsOpenProperty); get => (bool) GetValue(IsOpenProperty);
set => SetValue(IsOpenProperty, value); set => SetValue(IsOpenProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty MaskCanCloseProperty = DependencyProperty.Register( public static readonly DependencyProperty MaskCanCloseProperty = DependencyProperty.Register(
@@ -118,7 +118,7 @@ namespace HandyControl.Controls
public bool MaskCanClose public bool MaskCanClose
{ {
get => (bool) GetValue(MaskCanCloseProperty); get => (bool) GetValue(MaskCanCloseProperty);
set => SetValue(MaskCanCloseProperty, value); set => SetValue(MaskCanCloseProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ShowMaskProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowMaskProperty = DependencyProperty.Register(
@@ -127,7 +127,7 @@ namespace HandyControl.Controls
public bool ShowMask public bool ShowMask
{ {
get => (bool) GetValue(ShowMaskProperty); get => (bool) GetValue(ShowMaskProperty);
set => SetValue(ShowMaskProperty, value); set => SetValue(ShowMaskProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty DockProperty = DependencyProperty.Register( public static readonly DependencyProperty DockProperty = DependencyProperty.Register(
@@ -60,7 +60,7 @@ namespace HandyControl.Controls
public bool Animated public bool Animated
{ {
get => (bool) GetValue(AnimatedProperty); get => (bool) GetValue(AnimatedProperty);
set => SetValue(AnimatedProperty, value); set => SetValue(AnimatedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty AnimationTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty AnimationTimeProperty = DependencyProperty.Register(
@@ -87,7 +87,7 @@ namespace HandyControl.Controls
public bool AutoHiding public bool AutoHiding
{ {
get => (bool) GetValue(AutoHidingProperty); get => (bool) GetValue(AutoHidingProperty);
set => SetValue(AutoHidingProperty, value); set => SetValue(AutoHidingProperty, ValueBoxes.BooleanBox(value));
} }
protected override void OnClick() protected override void OnClick()
@@ -335,7 +335,7 @@ namespace HandyControl.Controls
public bool IsBlink public bool IsBlink
{ {
get => (bool)GetValue(IsBlinkProperty); get => (bool)GetValue(IsBlinkProperty);
set => SetValue(IsBlinkProperty, value); set => SetValue(IsBlinkProperty, ValueBoxes.BooleanBox(value));
} }
private void DispatcherTimerBlinkTick(object sender, EventArgs e) private void DispatcherTimerBlinkTick(object sender, EventArgs e)
@@ -231,7 +231,7 @@ namespace HandyControl.Controls
public bool IsJumpEnabled public bool IsJumpEnabled
{ {
get => (bool) GetValue(IsJumpEnabledProperty); get => (bool) GetValue(IsJumpEnabledProperty);
set => SetValue(IsJumpEnabledProperty, value); set => SetValue(IsJumpEnabledProperty, ValueBoxes.BooleanBox(value));
} }
#endregion #endregion
@@ -145,7 +145,7 @@ namespace HandyControl.Controls
public bool IsOpen public bool IsOpen
{ {
get => (bool) GetValue(IsOpenProperty); get => (bool) GetValue(IsOpenProperty);
set => SetValue(IsOpenProperty, value); set => SetValue(IsOpenProperty, ValueBoxes.BooleanBox(value));
} }
public static Poptip Default => new Poptip(); public static Poptip Default => new Poptip();
@@ -44,7 +44,7 @@ namespace HandyControl.Controls
public bool CanMouseWheel public bool CanMouseWheel
{ {
get => (bool) GetValue(CanMouseWheelProperty); get => (bool) GetValue(CanMouseWheelProperty);
set => SetValue(CanMouseWheelProperty, value); set => SetValue(CanMouseWheelProperty, ValueBoxes.BooleanBox(value));
} }
protected override void OnMouseWheel(MouseWheelEventArgs e) protected override void OnMouseWheel(MouseWheelEventArgs e)
@@ -155,7 +155,7 @@ namespace HandyControl.Controls
public bool IsInertiaEnabled public bool IsInertiaEnabled
{ {
get => (bool) GetValue(IsInertiaEnabledProperty); get => (bool) GetValue(IsInertiaEnabledProperty);
set => SetValue(IsInertiaEnabledProperty, value); set => SetValue(IsInertiaEnabledProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -170,7 +170,7 @@ namespace HandyControl.Controls
public bool IsPenetrating public bool IsPenetrating
{ {
get => (bool) GetValue(IsPenetratingProperty); get => (bool) GetValue(IsPenetratingProperty);
set => SetValue(IsPenetratingProperty, value); set => SetValue(IsPenetratingProperty, ValueBoxes.BooleanBox(value));
} }
public static void SetIsPenetrating(DependencyObject element, bool value) => element.SetValue(IsPenetratingProperty, ValueBoxes.BooleanBox(value)); public static void SetIsPenetrating(DependencyObject element, bool value) => element.SetValue(IsPenetratingProperty, ValueBoxes.BooleanBox(value));
@@ -77,7 +77,7 @@ namespace HandyControl.Controls
public bool AutoSizeEnabled public bool AutoSizeEnabled
{ {
get => (bool) GetValue(AutoSizeEnabledProperty); get => (bool) GetValue(AutoSizeEnabledProperty);
set => SetValue(AutoSizeEnabledProperty, value); set => SetValue(AutoSizeEnabledProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty MarkMarginProperty = DependencyProperty.Register( public static readonly DependencyProperty MarkMarginProperty = DependencyProperty.Register(
@@ -23,7 +23,7 @@ namespace HandyControl.Controls
public bool KeepVertical public bool KeepVertical
{ {
get => (bool) GetValue(KeepVerticalProperty); get => (bool) GetValue(KeepVerticalProperty);
set => SetValue(KeepVerticalProperty, value); set => SetValue(KeepVerticalProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty OffsetAngleProperty = DependencyProperty.Register( public static readonly DependencyProperty OffsetAngleProperty = DependencyProperty.Register(
@@ -47,7 +47,7 @@ namespace HandyControl.Controls
public bool IsFixed public bool IsFixed
{ {
get => (bool) GetValue(IsFixedProperty); get => (bool) GetValue(IsFixedProperty);
set => SetValue(IsFixedProperty, value); set => SetValue(IsFixedProperty, ValueBoxes.BooleanBox(value));
} }
internal int GetLayoutCellCount(ColLayoutStatus status) internal int GetLayoutCellCount(ColLayoutStatus status)
@@ -38,7 +38,7 @@ namespace HandyControl.Controls
public bool ShowText public bool ShowText
{ {
get => (bool) GetValue(ShowTextProperty); get => (bool) GetValue(ShowTextProperty);
set => SetValue(ShowTextProperty, value); set => SetValue(ShowTextProperty, ValueBoxes.BooleanBox(value));
} }
public double ArcThickness public double ArcThickness
@@ -86,7 +86,7 @@ namespace HandyControl.Controls
public bool ShowText public bool ShowText
{ {
get => (bool)GetValue(ShowTextProperty); get => (bool)GetValue(ShowTextProperty);
set => SetValue(ShowTextProperty, value); set => SetValue(ShowTextProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty WaveFillProperty = DependencyProperty.Register( public static readonly DependencyProperty WaveFillProperty = DependencyProperty.Register(
@@ -5,6 +5,7 @@ using System.Windows.Controls.Primitives;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Shapes; using System.Windows.Shapes;
using HandyControl.Data;
using HandyControl.Tools; using HandyControl.Tools;
namespace HandyControl.Controls namespace HandyControl.Controls
@@ -35,7 +36,7 @@ namespace HandyControl.Controls
var factory = new FrameworkElementFactory(typeof(Path)); var factory = new FrameworkElementFactory(typeof(Path));
factory.SetValue(FrameworkElement.WidthProperty, 12.0); factory.SetValue(FrameworkElement.WidthProperty, 12.0);
factory.SetValue(FrameworkElement.HeightProperty, 10.0); factory.SetValue(FrameworkElement.HeightProperty, ValueBoxes.Double10Box);
factory.SetBinding(Shape.FillProperty, new Binding(Control.ForegroundProperty.Name) factory.SetBinding(Shape.FillProperty, new Binding(Control.ForegroundProperty.Name)
{ {
RelativeSource = new RelativeSource RelativeSource = new RelativeSource
@@ -5,6 +5,7 @@ using System.Windows.Controls.Primitives;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Shapes; using System.Windows.Shapes;
using HandyControl.Data;
using HandyControl.Tools; using HandyControl.Tools;
namespace HandyControl.Controls namespace HandyControl.Controls
@@ -34,7 +35,7 @@ namespace HandyControl.Controls
}; };
var factory = new FrameworkElementFactory(typeof(Path)); var factory = new FrameworkElementFactory(typeof(Path));
factory.SetValue(FrameworkElement.WidthProperty, 10.0); factory.SetValue(FrameworkElement.WidthProperty, ValueBoxes.Double10Box);
factory.SetValue(FrameworkElement.HeightProperty, 12.0); factory.SetValue(FrameworkElement.HeightProperty, 12.0);
factory.SetBinding(Shape.FillProperty, new Binding(Control.ForegroundProperty.Name) factory.SetBinding(Shape.FillProperty, new Binding(Control.ForegroundProperty.Name)
{ {
@@ -68,7 +68,7 @@ namespace HandyControl.Controls
public bool IsReadOnly public bool IsReadOnly
{ {
get => (bool)GetValue(IsReadOnlyProperty); get => (bool)GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, value); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register( public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register(
@@ -113,7 +113,7 @@ namespace HandyControl.Controls
public bool IsSelected public bool IsSelected
{ {
get => (bool)GetValue(IsSelectedProperty); get => (bool)GetValue(IsSelectedProperty);
set => SetValue(IsSelectedProperty, value); set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty IsExpandedEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsExpandedEnabledProperty = DependencyProperty.Register(
@@ -122,7 +122,7 @@ namespace HandyControl.Controls
public bool IsExpandedEnabled public bool IsExpandedEnabled
{ {
get => (bool)GetValue(IsExpandedEnabledProperty); get => (bool)GetValue(IsExpandedEnabledProperty);
set => SetValue(IsExpandedEnabledProperty, value); set => SetValue(IsExpandedEnabledProperty, ValueBoxes.BooleanBox(value));
} }
public PropertyDescriptor PropertyDescriptor { get; set; } public PropertyDescriptor PropertyDescriptor { get; set; }
@@ -108,13 +108,13 @@ namespace HandyControl.Controls
public bool AllowHalf public bool AllowHalf
{ {
get => (bool) GetValue(AllowHalfProperty); get => (bool) GetValue(AllowHalfProperty);
set => SetValue(AllowHalfProperty, value); set => SetValue(AllowHalfProperty, ValueBoxes.BooleanBox(value));
} }
public bool AllowClear public bool AllowClear
{ {
get => (bool) GetValue(AllowClearProperty); get => (bool) GetValue(AllowClearProperty);
set => SetValue(AllowClearProperty, value); set => SetValue(AllowClearProperty, ValueBoxes.BooleanBox(value));
} }
public Geometry Icon public Geometry Icon
@@ -150,13 +150,13 @@ namespace HandyControl.Controls
public bool ShowText public bool ShowText
{ {
get => (bool) GetValue(ShowTextProperty); get => (bool) GetValue(ShowTextProperty);
set => SetValue(ShowTextProperty, value); set => SetValue(ShowTextProperty, ValueBoxes.BooleanBox(value));
} }
public bool IsReadOnly public bool IsReadOnly
{ {
get => (bool)GetValue(IsReadOnlyProperty); get => (bool)GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, value); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
} }
private void RateItemValueChanged(object sender, RoutedEventArgs e) => private void RateItemValueChanged(object sender, RoutedEventArgs e) =>
@@ -58,13 +58,13 @@ namespace HandyControl.Controls
public bool AllowClear public bool AllowClear
{ {
get => (bool) GetValue(AllowClearProperty); get => (bool) GetValue(AllowClearProperty);
set => SetValue(AllowClearProperty, value); set => SetValue(AllowClearProperty, ValueBoxes.BooleanBox(value));
} }
public bool AllowHalf public bool AllowHalf
{ {
get => (bool) GetValue(AllowHalfProperty); get => (bool) GetValue(AllowHalfProperty);
set => SetValue(AllowHalfProperty, value); set => SetValue(AllowHalfProperty, ValueBoxes.BooleanBox(value));
} }
public Geometry Icon public Geometry Icon
@@ -76,13 +76,13 @@ namespace HandyControl.Controls
internal bool IsSelected internal bool IsSelected
{ {
get => (bool) GetValue(IsSelectedProperty); get => (bool) GetValue(IsSelectedProperty);
set => SetValue(IsSelectedProperty, value); set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value));
} }
public bool IsReadOnly public bool IsReadOnly
{ {
get => (bool)GetValue(IsReadOnlyProperty); get => (bool)GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, value); set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
} }
internal bool IsHalf internal bool IsHalf
@@ -125,7 +125,7 @@ namespace HandyControl.Controls
public bool IsDrawing public bool IsDrawing
{ {
get => (bool)GetValue(IsDrawingProperty); get => (bool)GetValue(IsDrawingProperty);
internal set => SetValue(IsDrawingProperty, value); internal set => SetValue(IsDrawingProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty IsSelectingProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSelectingProperty = DependencyProperty.Register(
@@ -134,7 +134,7 @@ namespace HandyControl.Controls
public bool IsSelecting public bool IsSelecting
{ {
get => (bool)GetValue(IsSelectingProperty); get => (bool)GetValue(IsSelectingProperty);
internal set => SetValue(IsSelectingProperty, value); internal set => SetValue(IsSelectingProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty SizeProperty = DependencyProperty.Register( public static readonly DependencyProperty SizeProperty = DependencyProperty.Register(
@@ -127,7 +127,7 @@ namespace HandyControl.Controls
public bool AutoSelect public bool AutoSelect
{ {
get => (bool) GetValue(AutoSelectProperty); get => (bool) GetValue(AutoSelectProperty);
set => SetValue(AutoSelectProperty, value); set => SetValue(AutoSelectProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ExpandModeProperty = DependencyProperty.Register( public static readonly DependencyProperty ExpandModeProperty = DependencyProperty.Register(
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
public bool IsSelected public bool IsSelected
{ {
get => (bool) GetValue(IsSelectedProperty); get => (bool) GetValue(IsSelectedProperty);
set => SetValue(IsSelectedProperty, value); set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty RoleProperty = DependencyProperty.Register( public static readonly DependencyProperty RoleProperty = DependencyProperty.Register(
@@ -146,7 +146,7 @@ namespace HandyControl.Controls
public bool IsDirectionReversed public bool IsDirectionReversed
{ {
get => (bool)GetValue(IsDirectionReversedProperty); get => (bool)GetValue(IsDirectionReversedProperty);
set => SetValue(IsDirectionReversedProperty, value); set => SetValue(IsDirectionReversedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty DelayProperty = RepeatButton.DelayProperty.AddOwner(typeof(RangeSlider), new FrameworkPropertyMetadata(GetKeyboardDelay())); public static readonly DependencyProperty DelayProperty = RepeatButton.DelayProperty.AddOwner(typeof(RangeSlider), new FrameworkPropertyMetadata(GetKeyboardDelay()));
@@ -206,7 +206,7 @@ namespace HandyControl.Controls
public bool IsSnapToTickEnabled public bool IsSnapToTickEnabled
{ {
get => (bool)GetValue(IsSnapToTickEnabledProperty); get => (bool)GetValue(IsSnapToTickEnabledProperty);
set => SetValue(IsSnapToTickEnabledProperty, value); set => SetValue(IsSnapToTickEnabledProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty TickPlacementProperty = DependencyProperty.Register( public static readonly DependencyProperty TickPlacementProperty = DependencyProperty.Register(
@@ -243,7 +243,7 @@ namespace HandyControl.Controls
public bool IsMoveToPointEnabled public bool IsMoveToPointEnabled
{ {
get => (bool)GetValue(IsMoveToPointEnabledProperty); get => (bool)GetValue(IsMoveToPointEnabledProperty);
set => SetValue(IsMoveToPointEnabledProperty, value); set => SetValue(IsMoveToPointEnabledProperty, ValueBoxes.BooleanBox(value));
} }
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e) protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
@@ -170,7 +170,7 @@ namespace HandyControl.Controls
public bool IsDirectionReversed public bool IsDirectionReversed
{ {
get => (bool) GetValue(IsDirectionReversedProperty); get => (bool) GetValue(IsDirectionReversedProperty);
set => SetValue(IsDirectionReversedProperty, value); set => SetValue(IsDirectionReversedProperty, ValueBoxes.BooleanBox(value));
} }
protected override Visual GetVisualChild(int index) protected override Visual GetVisualChild(int index)
@@ -59,7 +59,7 @@ namespace HandyControl.Controls
public bool IsAnimationEnabled public bool IsAnimationEnabled
{ {
get => (bool)GetValue(IsAnimationEnabledProperty); get => (bool)GetValue(IsAnimationEnabledProperty);
set => SetValue(IsAnimationEnabledProperty, value); set => SetValue(IsAnimationEnabledProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -74,7 +74,7 @@ namespace HandyControl.Controls
public bool IsDraggable public bool IsDraggable
{ {
get => (bool)GetValue(IsDraggableProperty); get => (bool)GetValue(IsDraggableProperty);
set => SetValue(IsDraggableProperty, value); set => SetValue(IsDraggableProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -131,7 +131,7 @@ namespace HandyControl.Controls
public bool IsTabFillEnabled public bool IsTabFillEnabled
{ {
get => (bool)GetValue(IsTabFillEnabledProperty); get => (bool)GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, value); set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -176,7 +176,7 @@ namespace HandyControl.Controls
public bool IsScrollable public bool IsScrollable
{ {
get => (bool) GetValue(IsScrollableProperty); get => (bool) GetValue(IsScrollableProperty);
set => SetValue(IsScrollableProperty, value); set => SetValue(IsScrollableProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -191,7 +191,7 @@ namespace HandyControl.Controls
public bool ShowOverflowButton public bool ShowOverflowButton
{ {
get => (bool) GetValue(ShowOverflowButtonProperty); get => (bool) GetValue(ShowOverflowButtonProperty);
set => SetValue(ShowOverflowButtonProperty, value); set => SetValue(ShowOverflowButtonProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -206,7 +206,7 @@ namespace HandyControl.Controls
public bool ShowScrollButton public bool ShowScrollButton
{ {
get => (bool) GetValue(ShowScrollButtonProperty); get => (bool) GetValue(ShowScrollButtonProperty);
set => SetValue(ShowScrollButtonProperty, value); set => SetValue(ShowScrollButtonProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -173,7 +173,7 @@ namespace HandyControl.Controls
public bool ShowContextMenu public bool ShowContextMenu
{ {
get => (bool) GetValue(ShowContextMenuProperty); get => (bool) GetValue(ShowContextMenuProperty);
set => SetValue(ShowContextMenuProperty, value); set => SetValue(ShowContextMenuProperty, ValueBoxes.BooleanBox(value));
} }
public static void SetShowContextMenu(DependencyObject element, bool value) public static void SetShowContextMenu(DependencyObject element, bool value)
@@ -53,7 +53,7 @@ namespace HandyControl.Controls
public bool IsTabFillEnabled public bool IsTabFillEnabled
{ {
get => (bool)GetValue(IsTabFillEnabledProperty); get => (bool)GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, value); set => SetValue(IsTabFillEnabledProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -27,7 +27,7 @@ namespace HandyControl.Controls
public bool ShowCloseButton public bool ShowCloseButton
{ {
get => (bool) GetValue(ShowCloseButtonProperty); get => (bool) GetValue(ShowCloseButtonProperty);
set => SetValue(ShowCloseButtonProperty, value); set => SetValue(ShowCloseButtonProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty SelectableProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectableProperty = DependencyProperty.Register(
@@ -36,7 +36,7 @@ namespace HandyControl.Controls
public bool Selectable public bool Selectable
{ {
get => (bool) GetValue(SelectableProperty); get => (bool) GetValue(SelectableProperty);
set => SetValue(SelectableProperty, value); set => SetValue(SelectableProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
@@ -49,7 +49,7 @@ namespace HandyControl.Controls
public bool IsSelected public bool IsSelected
{ {
get => (bool) GetValue(IsSelectedProperty); get => (bool) GetValue(IsSelectedProperty);
set => SetValue(IsSelectedProperty, value); set => SetValue(IsSelectedProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly RoutedEvent SelectedEvent = EventManager.RegisterRoutedEvent("Selected", RoutingStrategy.Bubble, typeof(EventHandler), typeof(Tag)); public static readonly RoutedEvent SelectedEvent = EventManager.RegisterRoutedEvent("Selected", RoutingStrategy.Bubble, typeof(EventHandler), typeof(Tag));
@@ -45,7 +45,7 @@ namespace HandyControl.Controls
public bool ShowAddButton public bool ShowAddButton
{ {
get => (bool) GetValue(ShowAddButtonProperty); get => (bool) GetValue(ShowAddButtonProperty);
set => SetValue(ShowAddButtonProperty, value); set => SetValue(ShowAddButtonProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty TagMarginProperty = DependencyProperty.Register( public static readonly DependencyProperty TagMarginProperty = DependencyProperty.Register(
@@ -87,7 +87,7 @@ namespace HandyControl.Controls
public bool ShowConfirmButton public bool ShowConfirmButton
{ {
get => (bool)GetValue(ShowConfirmButtonProperty); get => (bool)GetValue(ShowConfirmButtonProperty);
set => SetValue(ShowConfirmButtonProperty, value); set => SetValue(ShowConfirmButtonProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register(
@@ -82,7 +82,7 @@ namespace HandyControl.Controls
internal bool ShowConfirmButton internal bool ShowConfirmButton
{ {
get => (bool) GetValue(ShowConfirmButtonProperty); get => (bool) GetValue(ShowConfirmButtonProperty);
set => SetValue(ShowConfirmButtonProperty, value); set => SetValue(ShowConfirmButtonProperty, ValueBoxes.BooleanBox(value));
} }
protected virtual void OnSelectedTimeChanged(FunctionEventArgs<DateTime?> e) => RaiseEvent(e); protected virtual void OnSelectedTimeChanged(FunctionEventArgs<DateTime?> e) => RaiseEvent(e);
@@ -216,7 +216,7 @@ namespace HandyControl.Controls
public bool ShowSpeStr public bool ShowSpeStr
{ {
get => (bool)GetValue(ShowSpeStrProperty); get => (bool)GetValue(ShowSpeStrProperty);
set => SetValue(ShowSpeStrProperty, value); set => SetValue(ShowSpeStrProperty, ValueBoxes.BooleanBox(value));
} }
/// <summary> /// <summary>
@@ -11,7 +11,7 @@ namespace HandyControl.Controls
public bool IsTransferred public bool IsTransferred
{ {
get => (bool) GetValue(IsTransferredProperty); get => (bool) GetValue(IsTransferredProperty);
set => SetValue(IsTransferredProperty, value); set => SetValue(IsTransferredProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty IsOriginProperty = DependencyProperty.Register( public static readonly DependencyProperty IsOriginProperty = DependencyProperty.Register(
@@ -20,7 +20,7 @@ namespace HandyControl.Controls
public bool IsOrigin public bool IsOrigin
{ {
get => (bool) GetValue(IsOriginProperty); get => (bool) GetValue(IsOriginProperty);
internal set => SetValue(IsOriginProperty, value); internal set => SetValue(IsOriginProperty, ValueBoxes.BooleanBox(value));
} }
} }
} }
@@ -61,7 +61,7 @@ namespace HandyControl.Controls
public bool ShowImage public bool ShowImage
{ {
get => (bool)GetValue(ShowImageProperty); get => (bool)GetValue(ShowImageProperty);
set => SetValue(ShowImageProperty, value); set => SetValue(ShowImageProperty, ValueBoxes.BooleanBox(value));
} }
private MessageBox() private MessageBox()
@@ -109,7 +109,7 @@ namespace HandyControl.Controls
public bool ShowTitle public bool ShowTitle
{ {
get => (bool) GetValue(ShowTitleProperty); get => (bool) GetValue(ShowTitleProperty);
set => SetValue(ShowTitleProperty, value); set => SetValue(ShowTitleProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ShowCancelProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowCancelProperty = DependencyProperty.Register(
@@ -118,7 +118,7 @@ namespace HandyControl.Controls
public bool ShowCancel public bool ShowCancel
{ {
get => (bool)GetValue(ShowCancelProperty); get => (bool)GetValue(ShowCancelProperty);
set => SetValue(ShowCancelProperty, value); set => SetValue(ShowCancelProperty, ValueBoxes.BooleanBox(value));
} }
public static readonly DependencyProperty ShowBorderProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowBorderProperty = DependencyProperty.Register(
@@ -127,7 +127,7 @@ namespace HandyControl.Controls
public bool ShowBorder public bool ShowBorder
{ {
get => (bool) GetValue(ShowBorderProperty); get => (bool) GetValue(ShowBorderProperty);
set => SetValue(ShowBorderProperty, value); set => SetValue(ShowBorderProperty, ValueBoxes.BooleanBox(value));
} }
private void TitleBlock_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) private void TitleBlock_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
@@ -208,7 +208,7 @@ namespace HandyControl.Controls
public bool IsFullScreen public bool IsFullScreen
{ {
get => (bool)GetValue(IsFullScreenProperty); get => (bool)GetValue(IsFullScreenProperty);
set => SetValue(IsFullScreenProperty, value); set => SetValue(IsFullScreenProperty, ValueBoxes.BooleanBox(value));
} }
public object NonClientAreaContent public object NonClientAreaContent
@@ -256,13 +256,13 @@ namespace HandyControl.Controls
public bool ShowNonClientArea public bool ShowNonClientArea
{ {
get => (bool)GetValue(ShowNonClientAreaProperty); get => (bool)GetValue(ShowNonClientAreaProperty);
set => SetValue(ShowNonClientAreaProperty, value); set => SetValue(ShowNonClientAreaProperty, ValueBoxes.BooleanBox(value));
} }
public bool ShowTitle public bool ShowTitle
{ {
get => (bool)GetValue(ShowTitleProperty); get => (bool)GetValue(ShowTitleProperty);
set => SetValue(ShowTitleProperty, value); set => SetValue(ShowTitleProperty, ValueBoxes.BooleanBox(value));
} }
private static void OnShowNonClientAreaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnShowNonClientAreaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -79,7 +79,7 @@ namespace HandyControl.Interactivity
{ {
get => get =>
(bool) GetValue(FloatAboveProperty); (bool) GetValue(FloatAboveProperty);
set => SetValue(FloatAboveProperty, value); set => SetValue(FloatAboveProperty, ValueBoxes.BooleanBox(value));
} }
public TagType InitialTag public TagType InitialTag
@@ -283,7 +283,7 @@ namespace HandyControl.Interactivity
private static void SetHasTransformWrapper(DependencyObject obj, bool value) 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) private static void SetOverlay(DependencyObject obj, object value)
@@ -46,7 +46,7 @@ namespace HandyControl.Interactivity
{ {
get => get =>
(bool) GetValue(IsActiveProperty); (bool) GetValue(IsActiveProperty);
set => SetValue(IsActiveProperty, value); set => SetValue(IsActiveProperty, ValueBoxes.BooleanBox(value));
} }
protected virtual bool ShouldSkipInitialLayout => protected virtual bool ShouldSkipInitialLayout =>
@@ -27,9 +27,8 @@ namespace HandyControl.Interactivity
public bool ConstrainToParentBounds public bool ConstrainToParentBounds
{ {
get => get => (bool) GetValue(ConstrainToParentBoundsProperty);
(bool) GetValue(ConstrainToParentBoundsProperty); set => SetValue(ConstrainToParentBoundsProperty, ValueBoxes.BooleanBox(value));
set => SetValue(ConstrainToParentBoundsProperty, value);
} }
private Rect ElementBounds private Rect ElementBounds
@@ -50,7 +50,7 @@ namespace HandyControl.Interactivity
public bool ConstrainToParentBounds public bool ConstrainToParentBounds
{ {
get => (bool)GetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty); get => (bool)GetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty);
set => SetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty, value); set => SetValue(MouseDragElementBehavior.ConstrainToParentBoundsProperty, ValueBoxes.BooleanBox(value));
} }
private Rect ElementBounds private Rect ElementBounds
@@ -96,7 +96,7 @@ namespace HandyControl.Interactivity
public bool MustToggleIsEnabled public bool MustToggleIsEnabled
{ {
get => (bool) GetValue(MustToggleIsEnabledProperty); get => (bool) GetValue(MustToggleIsEnabledProperty);
set => SetValue(MustToggleIsEnabledProperty, value); set => SetValue(MustToggleIsEnabledProperty, ValueBoxes.BooleanBox(value));
} }
public bool MustToggleIsEnabledValue public bool MustToggleIsEnabledValue
@@ -127,7 +127,7 @@ namespace HandyControl.Interactivity
public bool AlwaysInvokeCommand public bool AlwaysInvokeCommand
{ {
get => (bool) GetValue(AlwaysInvokeCommandProperty); get => (bool) GetValue(AlwaysInvokeCommandProperty);
set => SetValue(AlwaysInvokeCommandProperty, value); set => SetValue(AlwaysInvokeCommandProperty, ValueBoxes.BooleanBox(value));
} }
protected override void OnAttached() protected override void OnAttached()
@@ -879,7 +879,7 @@ namespace HandyControl.Interactivity
internal static void SetDidCacheBackground(DependencyObject obj, bool value) 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) internal static void SetLayoutStoryboard(DependencyObject obj, Storyboard value)
@@ -937,7 +937,7 @@ namespace HandyControl.Interactivity
public static void SetUseFluidLayout(DependencyObject obj, bool value) public static void SetUseFluidLayout(DependencyObject obj, bool value)
{ {
obj.SetValue(UseFluidLayoutProperty, value); obj.SetValue(UseFluidLayoutProperty, ValueBoxes.BooleanBox(value));
} }
private static void StopAnimations() private static void StopAnimations()
@@ -3,6 +3,7 @@ using System.Globalization;
using System.Windows; using System.Windows;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using HandyControl.Data;
namespace HandyControl.Interactivity namespace HandyControl.Interactivity
{ {
@@ -43,9 +44,8 @@ namespace HandyControl.Interactivity
public bool IsEnabled public bool IsEnabled
{ {
get => get => (bool) GetValue(IsEnabledProperty);
(bool) GetValue(IsEnabledProperty); set => SetValue(IsEnabledProperty, ValueBoxes.BooleanBox(value));
set => SetValue(IsEnabledProperty, value);
} }
internal bool IsHosted internal bool IsHosted