Rename IApplication.Current to TopRunnable

Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-20 19:34:48 +00:00
parent 16b42e86fd
commit 4b975fd5b7
90 changed files with 916 additions and 820 deletions

View File

@@ -89,13 +89,13 @@ public class CanFocusTests
public void CanFocus_Set_True_Get_AdvanceFocus_Works ()
{
IApplication app = Application.Create ();
app.Current = new () { App = app };
app.TopRunnable = new () { App = app };
Label label = new () { Text = "label" };
View view = new () { Text = "view", CanFocus = true };
app.Current.Add (label, view);
app.TopRunnable.Add (label, view);
app.Current.SetFocus ();
app.TopRunnable.SetFocus ();
Assert.Equal (view, app.Navigation!.GetFocused ());
Assert.False (label.CanFocus);
Assert.False (label.HasFocus);
@@ -125,7 +125,7 @@ public class CanFocusTests
Assert.True (label.HasFocus);
Assert.False (view.HasFocus);
app.Current.Dispose ();
app.TopRunnable.Dispose ();
app.ResetState ();
}
}

View File

@@ -27,7 +27,7 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
}
Toplevel top = new ();
Application.Current = top;
Application.TopRunnable = top;
View otherView = new ()
{
@@ -117,7 +117,7 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
}
Toplevel top = new ();
Application.Current = top;
Application.TopRunnable = top;
View otherView = new ()
{
@@ -148,8 +148,8 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
// Ensure the view is Visible
view.Visible = true;
Application.Current.SetFocus ();
Assert.True (Application.Current!.HasFocus);
Application.TopRunnable.SetFocus ();
Assert.True (Application.TopRunnable!.HasFocus);
Assert.True (top.HasFocus);
// Start with the focus on our test view
@@ -280,7 +280,7 @@ public class NavigationTests (ITestOutputHelper output) : TestsAllViews
Toplevel top = new ();
Application.Current = top;
Application.TopRunnable = top;
View otherView = new ()
{