improve:白板翻页性能
This commit is contained in:
@@ -331,10 +331,16 @@ namespace Ink_Canvas
|
|||||||
var list = new List<TimeMachineHistory>();
|
var list = new List<TimeMachineHistory>();
|
||||||
if (fakeInkCanv.Strokes.Count > 0)
|
if (fakeInkCanv.Strokes.Count > 0)
|
||||||
list.Add(new TimeMachineHistory(fakeInkCanv.Strokes.Clone(), TimeMachineHistoryType.UserInput, false));
|
list.Add(new TimeMachineHistory(fakeInkCanv.Strokes.Clone(), TimeMachineHistoryType.UserInput, false));
|
||||||
foreach (UIElement child in fakeInkCanv.Children)
|
var childrenSnapshot = new List<UIElement>();
|
||||||
|
foreach (UIElement c in fakeInkCanv.Children)
|
||||||
|
childrenSnapshot.Add(c);
|
||||||
|
foreach (UIElement child in childrenSnapshot)
|
||||||
{
|
{
|
||||||
if (child is Image || child is MediaElement)
|
if (child is Image || child is MediaElement)
|
||||||
|
{
|
||||||
list.Add(new TimeMachineHistory(child, TimeMachineHistoryType.ElementInsert));
|
list.Add(new TimeMachineHistory(child, TimeMachineHistoryType.ElementInsert));
|
||||||
|
fakeInkCanv.Children.Remove(child);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return list.Count == 0 ? null : list.ToArray();
|
return list.Count == 0 ? null : list.ToArray();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user