We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
App.GetLauncher()
FindAncestorOfType
1 parent f356a7b commit 2f06b9eCopy full SHA for 2f06b9e
src/Views/RepositoryCommandPaletteTextBox.cs
@@ -1,8 +1,8 @@
1
using System;
2
+
3
using Avalonia;
4
using Avalonia.Controls;
5
using Avalonia.Input;
-using Avalonia.VisualTree;
6
7
namespace SourceGit.Views
8
{
@@ -14,9 +14,8 @@ protected override void OnKeyDown(KeyEventArgs e)
14
15
if (e.Key == Key.Back && string.IsNullOrEmpty(Text))
16
17
- var launcherView = this.FindAncestorOfType<Launcher>(false);
18
- if (launcherView is { DataContext: ViewModels.Launcher launcher } &&
19
- launcher.ActivePage is { Data: ViewModels.Repository repo })
+ var launcher = App.GetLauncher();
+ if (launcher is { ActivePage: { Data: ViewModels.Repository repo } })
20
21
launcher.CommandPalette = new ViewModels.RepositoryCommandPalette(repo);
22
e.Handled = true;
0 commit comments