Skip to content

Commit

Permalink
Re-add jumpTimer
Browse files Browse the repository at this point in the history
  • Loading branch information
d2dyno1 committed Mar 21, 2021
1 parent 6b7db72 commit 232ec15
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Files/BaseLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace Files
/// </summary>
public abstract class BaseLayout : Page, IBaseLayout, INotifyPropertyChanged
{
private readonly DispatcherTimer jumpTimer;

protected NamedPipeAsAppServiceConnection Connection => ParentShellPageInstance?.ServiceConnection;

public SelectedItemsPropertiesViewModel SelectedItemsPropertiesViewModel { get; }
Expand Down Expand Up @@ -132,9 +134,8 @@ public string JumpString
ScrollIntoView(jumpedToItem);
}

// Reset
jumpString = "";
return;
// Restart the timer
jumpTimer.Start();
}
jumpString = value;
}
Expand Down Expand Up @@ -208,6 +209,10 @@ internal set

public BaseLayout()
{
jumpTimer = new DispatcherTimer();
jumpTimer.Interval = TimeSpan.FromSeconds(0.8);
jumpTimer.Tick += JumpTimer_Tick; ;

SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(this);
DirectoryPropertiesViewModel = new DirectoryPropertiesViewModel();

Expand All @@ -223,6 +228,12 @@ public BaseLayout()
dragOverTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
}

private void JumpTimer_Tick(object sender, object e)
{
jumpString = string.Empty;
jumpTimer.Stop();
}

protected abstract void InitializeCommandsViewModel();

public abstract void FocusFileList();
Expand Down

0 comments on commit 232ec15

Please sign in to comment.