mirror of
https://github.com/tuxdotrs/highminded.git
synced 2025-08-23 16:11:02 +05:30
refactor: cleaup and implemented mvvm
This commit is contained in:
@@ -9,20 +9,11 @@ public partial class SettingsUserControl : UserControl
|
||||
public SettingsUserControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ModelTextBox.Text = InMemoryDb.Obj.SettingsManager.Settings.Model;
|
||||
ApiUrlTextBox.Text = InMemoryDb.Obj.SettingsManager.Settings.ApiURL;
|
||||
ApiKeyTextBox.Text = InMemoryDb.Obj.SettingsManager.Settings.ApiKey;
|
||||
ScreenshotPromptTextBox.Text = InMemoryDb.Obj.SettingsManager.Settings.ScreenshotPrompt;
|
||||
AudioPromptTextbox.Text = InMemoryDb.Obj.SettingsManager.Settings.AudioPrompt;
|
||||
DataContext = InMemoryDb.Obj.SettingsViewModel;
|
||||
}
|
||||
|
||||
private void SaveSettingsBtn_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
InMemoryDb.Obj.SaveSettings(new AppSettings()
|
||||
{
|
||||
ApiKey = ApiKeyTextBox.Text, ApiURL = ApiUrlTextBox.Text, Model = ModelTextBox.Text,
|
||||
ScreenshotPrompt = ScreenshotPromptTextBox.Text, AudioPrompt = AudioPromptTextbox.Text
|
||||
});
|
||||
InMemoryDb.Obj.SaveSettings();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user