This commit is contained in:
NaBian committed 2020-01-05 23:34:39 +08:00
1 parent 515b4b1ab6
commit 1285286e0e
19 files changed
+58 -58

No files matched your search

@@ -21,7 +21,7 @@ namespace HandyControl.Controls
Content = new ScrollViewer
{
VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
IsEnableInertia = true,
IsInertiaEnabled = true,
Content = GrowlPanel
};
}
@@ -35,7 +35,7 @@ namespace HandyControl.Controls
{
_scrollViewer.ScrollChanged += ScrollViewer_ScrollChanged;
if (_scrollViewer is ScrollViewer scrollViewerHandy && Animated && scrollViewerHandy.IsEnableInertia)
if (_scrollViewer is ScrollViewer scrollViewerHandy && Animated && scrollViewerHandy.IsInertiaEnabled)
{
_gotoTopAction = () => scrollViewerHandy.ScrollToTopInternal(AnimationTime);
}
@@ -51,7 +51,7 @@ namespace HandyControl.Controls
{
if (!CanMouseWheel) return;
if (!IsEnableInertia)
if (!IsInertiaEnabled)
{
if (Orientation == Orientation.Vertical)
{
@@ -142,26 +142,26 @@ namespace HandyControl.Controls
/// <summary>
/// 是否支持惯性
/// </summary>
public static readonly DependencyProperty IsEnableInertiaProperty = DependencyProperty.RegisterAttached(
"IsEnableInertia", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.FalseBox));
public static readonly DependencyProperty IsInertiaEnabledProperty = DependencyProperty.RegisterAttached(
"IsInertiaEnabled", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.FalseBox));
public static void SetIsEnableInertia(DependencyObject element, bool value)
public static void SetIsInertiaEnabled(DependencyObject element, bool value)
{
element.SetValue(IsEnableInertiaProperty, value);
element.SetValue(IsInertiaEnabledProperty, value);
}
public static bool GetIsEnableInertia(DependencyObject element)
public static bool GetIsInertiaEnabled(DependencyObject element)
{
return (bool)element.GetValue(IsEnableInertiaProperty);
return (bool)element.GetValue(IsInertiaEnabledProperty);
}
/// <summary>
/// 是否支持惯性
/// </summary>
public bool IsEnableInertia
public bool IsInertiaEnabled
{
get => (bool) GetValue(IsEnableInertiaProperty);
set => SetValue(IsEnableInertiaProperty, value);
get => (bool) GetValue(IsInertiaEnabledProperty);
set => SetValue(IsInertiaEnabledProperty, value);
}
/// <summary>
@@ -50,16 +50,16 @@ namespace HandyControl.Controls
/// <summary>
/// 是否启用动画
/// </summary>
public static readonly DependencyProperty IsEnableAnimationProperty = DependencyProperty.Register(
"IsEnableAnimation", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
public static readonly DependencyProperty IsAnimationEnabledProperty = DependencyProperty.Register(
"IsAnimationEnabled", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary>
/// 是否启用动画
/// </summary>
public bool IsEnableAnimation
public bool IsAnimationEnabled
{
get => (bool)GetValue(IsEnableAnimationProperty);
set => SetValue(IsEnableAnimationProperty, value);
get => (bool)GetValue(IsAnimationEnabledProperty);
set => SetValue(IsAnimationEnabledProperty, value);
}
/// <summary>
@@ -122,16 +122,16 @@ namespace HandyControl.Controls
/// <summary>
/// 是否将标签填充
/// </summary>
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
"IsEnableTabFill", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register(
"IsTabFillEnabled", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary>
/// 是否将标签填充
/// </summary>
public bool IsEnableTabFill
public bool IsTabFillEnabled
{
get => (bool)GetValue(IsEnableTabFillProperty);
set => SetValue(IsEnableTabFillProperty, value);
get => (bool)GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, value);
}
/// <summary>
@@ -224,7 +224,7 @@ namespace HandyControl.Controls
return;
}
if (!IsEnableTabFill)
if (!IsTabFillEnabled)
{
_itemShowCount = (int)(ActualWidth / TabItemWidth);
_buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
@@ -236,7 +236,7 @@ namespace HandyControl.Controls
return;
}
if (IsEnableAnimation)
if (IsAnimationEnabled)
{
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
}
@@ -279,7 +279,7 @@ namespace HandyControl.Controls
base.OnApplyTemplate();
HeaderPanel = GetTemplateChild(HeaderPanelKey) as TabPanel;
if (IsEnableTabFill) return;
if (IsTabFillEnabled) return;
_buttonOverflow = GetTemplateChild(OverflowButtonKey) as ContextMenuToggleButton;
_scrollViewerOverflow = GetTemplateChild(OverflowScrollviewer) as ScrollViewer;
@@ -357,7 +357,7 @@ namespace HandyControl.Controls
{
list.Remove(actualItem);
list.Insert(0, actualItem);
if (IsEnableAnimation)
if (IsAnimationEnabled)
{
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
}
@@ -278,7 +278,7 @@ namespace HandyControl.Controls
RaiseEvent(argsClosing);
if (argsClosing.Cancel) return;
TabPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, parent.IsEnableAnimation
TabPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, parent.IsAnimationEnabled
? new Duration(TimeSpan.FromMilliseconds(200))
: new Duration(TimeSpan.FromMilliseconds(1)));
@@ -419,7 +419,7 @@ namespace HandyControl.Controls
}
TargetOffsetX = resultX;
if (!parent.IsEnableAnimation)
if (!parent.IsAnimationEnabled)
{
AnimationCompleted();
return;
@@ -40,16 +40,16 @@ namespace HandyControl.Controls
/// <summary>
/// 是否将标签填充
/// </summary>
public static readonly DependencyProperty IsEnableTabFillProperty = DependencyProperty.Register(
"IsEnableTabFill", typeof(bool), typeof(TabPanel), new PropertyMetadata(ValueBoxes.FalseBox));
public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register(
"IsTabFillEnabled", typeof(bool), typeof(TabPanel), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary>
/// 是否将标签填充
/// </summary>
public bool IsEnableTabFill
public bool IsTabFillEnabled
{
get => (bool)GetValue(IsEnableTabFillProperty);
set => SetValue(IsEnableTabFillProperty, value);
get => (bool)GetValue(IsTabFillEnabledProperty);
set => SetValue(IsTabFillEnabledProperty, value);
}
/// <summary>
@@ -115,7 +115,7 @@ namespace HandyControl.Controls
var itemWidth = .0;
var arr = new int[count];
if (!IsEnableTabFill)
if (!IsTabFillEnabled)
{
itemWidth = TabItemWidth;
}
@@ -129,7 +129,7 @@ namespace HandyControl.Controls
for (var index = 0; index < count; index++)
{
if (IsEnableTabFill)
if (IsTabFillEnabled)
{
itemWidth = arr[index];
}