Jumar Macato
6 years ago
No known key found for this signature in database
GPG Key ID: B19884DAC3A5BF3F
2 changed files with
5 additions and
3 deletions
-
src/Avalonia.Base/Threading/DispatcherTimer.cs
-
src/Avalonia.Controls/TreeView.cs
|
|
|
@ -14,7 +14,7 @@ namespace Avalonia.Threading |
|
|
|
private readonly DispatcherPriority _priority; |
|
|
|
|
|
|
|
private TimeSpan _interval; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="DispatcherTimer"/> class.
|
|
|
|
/// </summary>
|
|
|
|
@ -154,6 +154,8 @@ namespace Avalonia.Threading |
|
|
|
TimeSpan interval, |
|
|
|
DispatcherPriority priority = DispatcherPriority.Normal) |
|
|
|
{ |
|
|
|
interval = (interval != TimeSpan.Zero) ? interval : TimeSpan.FromTicks(1); |
|
|
|
|
|
|
|
var timer = new DispatcherTimer(priority) { Interval = interval }; |
|
|
|
|
|
|
|
timer.Tick += (s, e) => |
|
|
|
@ -197,7 +199,7 @@ namespace Avalonia.Threading |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Raises the <see cref="Tick"/> event on the dispatcher thread.
|
|
|
|
|
|
|
|
@ -347,7 +347,7 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
if (container != null) |
|
|
|
{ |
|
|
|
DispatcherTimer.RunOnce(container.BringIntoView, TimeSpan.FromTicks(1)); |
|
|
|
DispatcherTimer.RunOnce(container.BringIntoView, TimeSpan.Zero); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|