Browse Source

Move webview dialog to debug card

pull/14/head
Ionite 1 year ago
parent
commit
963bd40d13
No known key found for this signature in database
  1. 20
      StabilityMatrix/SettingsPage.xaml
  2. 15
      StabilityMatrix/ViewModels/SettingsViewModel.cs

20
StabilityMatrix/SettingsPage.xaml

@ -126,22 +126,6 @@
</StackPanel>
</ui:Card>
<ui:Card Margin="8">
<StackPanel HorizontalAlignment="Left" Orientation="Vertical">
<TextBlock
FontSize="16"
FontWeight="Bold"
Margin="0,8"
Text="Update Preferences" />
<StackPanel Orientation="Horizontal">
<ui:Button
Command="{Binding LoginCommand}"
Content="Login"
Margin="8" />
</StackPanel>
</StackPanel>
</ui:Card>
<ui:Card Margin="8">
<StackPanel HorizontalAlignment="Left" Orientation="Vertical">
<TextBlock
@ -204,6 +188,10 @@
Command="{Binding ModelFileSearchCommand}"
Content="Model File Search"
Margin="8" />
<Button
Command="{Binding WebViewDemoCommand}"
Content="Open WebView"
Margin="8" />
</StackPanel>
</StackPanel>
</ui:Card>

15
StabilityMatrix/ViewModels/SettingsViewModel.cs

@ -269,20 +269,21 @@ public partial class SettingsViewModel : ObservableObject
}
[RelayCommand]
private async Task LoginAsync()
private async Task WebViewDemo()
{
var uri = new Uri("https://www.patreon.com/login");
var enterUri = await dialogFactory.ShowTextEntryDialog("Enter a URI",
new[] {
("Enter URI", "https://lykos.ai")
});
if (enterUri == null) return;
var uri = new Uri(enterUri.First());
var dialog = dialogFactory.CreateWebLoginDialog();
var loginViewModel = dialog.ViewModel;
loginViewModel.CurrentUri = uri;
// Pre-navigate before showing dialog
// var task = loginViewModel.WaitForNavigation(uri);
// var result = await snackbarService.TryAsync(task, "Failed to load login page");
var dialogResult = await dialog.ShowAsync();
// TODO: Handle dialog result
logger.LogInformation("LoginDialog result: {Result}", dialogResult);
}
[RelayCommand]

Loading…
Cancel
Save