Skip to content

Commit

Permalink
fix: Enable opening settings dialog in ExtensionsPage
Browse files Browse the repository at this point in the history
  • Loading branch information
yuto-trd committed Sep 6, 2024
1 parent a7a36f7 commit cf37e9b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Beutl/Pages/ExtensionsPage.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,18 @@ private void Search_Click(object? sender, RoutedEventArgs e)
frame.Navigate(typeof(SearchPage), searchTextBox.Text);
}

private void OpenSettings_Click(object? sender, RoutedEventArgs e)
private async void OpenSettings_Click(object? sender, RoutedEventArgs e)
{
// TODO: 設定ウィンドウを開く
// if (this.FindLogicalAncestorOfType<MainView>() is { DataContext: MainViewModel viewModel })
// {
// viewModel.SelectedPage.Value = viewModel.SettingsPage;
// }
if (this.FindLogicalAncestorOfType<MainView>() is not { DataContext: MainViewModel viewModel })
return;

if (TopLevel.GetTopLevel(this) is not Window window)
return;

var settingsPage = viewModel.SettingsPage;
var dialog = new SettingsDialog { DataContext = settingsPage };
settingsPage.GoToAccountSettingsPage();
await dialog.ShowDialog(window);
}

private static List<NavigationViewItem> GetItems()
Expand Down

0 comments on commit cf37e9b

Please sign in to comment.