fixed #352
This commit is contained in:
1 parent
0b666d7fa1
commit
91f68b5d8f
3 files changed
+12
-17
No files matched your search
@@ -232,15 +232,6 @@ namespace HandyControl.Controls
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsAnimationEnabled)
|
|
||||||
{
|
|
||||||
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
HeaderPanel.FluidMoveDuration = new Duration(TimeSpan.FromSeconds(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e.Action == NotifyCollectionChangedAction.Add)
|
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < Items.Count; i++)
|
for (var i = 0; i < Items.Count; i++)
|
||||||
@@ -252,7 +243,6 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
_headerBorder?.InvalidateMeasure();
|
_headerBorder?.InvalidateMeasure();
|
||||||
|
|
||||||
IsInternalAction = false;
|
IsInternalAction = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,11 +351,11 @@ namespace HandyControl.Controls
|
|||||||
list.Insert(0, actualItem);
|
list.Insert(0, actualItem);
|
||||||
if (IsAnimationEnabled)
|
if (IsAnimationEnabled)
|
||||||
{
|
{
|
||||||
HeaderPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, new Duration(TimeSpan.FromMilliseconds(200)));
|
HeaderPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, new Duration(TimeSpan.FromMilliseconds(200)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HeaderPanel.FluidMoveDuration = new Duration(TimeSpan.FromSeconds(0));
|
HeaderPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, new Duration(TimeSpan.FromMilliseconds(0)));
|
||||||
}
|
}
|
||||||
HeaderPanel.ForceUpdate = true;
|
HeaderPanel.ForceUpdate = true;
|
||||||
HeaderPanel.Measure(new Size(HeaderPanel.DesiredSize.Width, ActualHeight));
|
HeaderPanel.Measure(new Size(HeaderPanel.DesiredSize.Width, ActualHeight));
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ namespace HandyControl.Controls
|
|||||||
RaiseEvent(argsClosing);
|
RaiseEvent(argsClosing);
|
||||||
if (argsClosing.Cancel) return;
|
if (argsClosing.Cancel) return;
|
||||||
|
|
||||||
TabPanel.SetCurrentValue(TabPanel.FluidMoveDurationProperty, parent.IsAnimationEnabled
|
TabPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, parent.IsAnimationEnabled
|
||||||
? new Duration(TimeSpan.FromMilliseconds(200))
|
? new Duration(TimeSpan.FromMilliseconds(200))
|
||||||
: new Duration(TimeSpan.FromMilliseconds(1)));
|
: new Duration(TimeSpan.FromMilliseconds(1)));
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ namespace HandyControl.Controls
|
|||||||
if (parent.IsDraggable && !ItemIsDragging && !_isDragging)
|
if (parent.IsDraggable && !ItemIsDragging && !_isDragging)
|
||||||
{
|
{
|
||||||
parent.UpdateScroll();
|
parent.UpdateScroll();
|
||||||
TabPanel.FluidMoveDuration = new Duration(TimeSpan.FromSeconds(0));
|
TabPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, new Duration(TimeSpan.FromSeconds(0)));
|
||||||
_mouseDownOffsetX = RenderTransform.Value.OffsetX;
|
_mouseDownOffsetX = RenderTransform.Value.OffsetX;
|
||||||
_scrollHorizontalOffset = parent.GetHorizontalOffset();
|
_scrollHorizontalOffset = parent.GetHorizontalOffset();
|
||||||
var mx = TranslatePoint(new Point(), parent).X + _scrollHorizontalOffset;
|
var mx = TranslatePoint(new Point(), parent).X + _scrollHorizontalOffset;
|
||||||
@@ -407,6 +407,7 @@ namespace HandyControl.Controls
|
|||||||
list.Remove(item);
|
list.Remove(item);
|
||||||
parent.IsInternalAction = true;
|
parent.IsInternalAction = true;
|
||||||
list.Insert(index, item);
|
list.Insert(index, item);
|
||||||
|
_tabPanel.SetValue(TabPanel.FluidMoveDurationPropertyKey, new Duration(TimeSpan.FromMilliseconds(0)));
|
||||||
TabPanel.CanUpdate = true;
|
TabPanel.CanUpdate = true;
|
||||||
TabPanel.ForceUpdate = true;
|
TabPanel.ForceUpdate = true;
|
||||||
TabPanel.Measure(new Size(TabPanel.DesiredSize.Width, ActualHeight));
|
TabPanel.Measure(new Size(TabPanel.DesiredSize.Width, ActualHeight));
|
||||||
|
|||||||
@@ -22,11 +22,15 @@ namespace HandyControl.Controls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal Dictionary<int, TabItem> ItemDic = new Dictionary<int, TabItem>();
|
internal Dictionary<int, TabItem> ItemDic = new Dictionary<int, TabItem>();
|
||||||
|
|
||||||
|
public static readonly DependencyPropertyKey FluidMoveDurationPropertyKey =
|
||||||
|
DependencyProperty.RegisterReadOnly("FluidMoveDuration", typeof(Duration), typeof(TabPanel),
|
||||||
|
new PropertyMetadata(new Duration(TimeSpan.FromMilliseconds(0))));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 流式行为持续时间
|
/// 流式行为持续时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty FluidMoveDurationProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty FluidMoveDurationProperty =
|
||||||
"FluidMoveDuration", typeof(Duration), typeof(TabPanel), new PropertyMetadata(new Duration(TimeSpan.FromMilliseconds(200))));
|
FluidMoveDurationPropertyKey.DependencyProperty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 流式行为持续时间
|
/// 流式行为持续时间
|
||||||
@@ -96,7 +100,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
protected override Size MeasureOverride(Size constraint)
|
protected override Size MeasureOverride(Size constraint)
|
||||||
{
|
{
|
||||||
if ((_itemCount == InternalChildren.Count || !CanUpdate) && !ForceUpdate) return _oldSize;
|
if ((_itemCount == InternalChildren.Count || !CanUpdate) && !ForceUpdate && !IsTabFillEnabled) return _oldSize;
|
||||||
constraint.Height = TabItemHeight;
|
constraint.Height = TabItemHeight;
|
||||||
_itemCount = InternalChildren.Count;
|
_itemCount = InternalChildren.Count;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user