aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs')
-rw-r--r--src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs
new file mode 100644
index 00000000..2c9eac28
--- /dev/null
+++ b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs
@@ -0,0 +1,37 @@
+using Avalonia.Controls;
+using Ryujinx.Ava.UI.ViewModels;
+using TimeZone = Ryujinx.Ava.UI.Models.TimeZone;
+
+namespace Ryujinx.Ava.UI.Views.Settings
+{
+ public partial class SettingsSystemView : UserControl
+ {
+ public SettingsViewModel ViewModel;
+
+ public SettingsSystemView()
+ {
+ InitializeComponent();
+ }
+
+ private void TimeZoneBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if (e.AddedItems != null && e.AddedItems.Count > 0)
+ {
+ if (e.AddedItems[0] is TimeZone timeZone)
+ {
+ e.Handled = true;
+
+ ViewModel.ValidateAndSetTimeZone(timeZone.Location);
+ }
+ }
+ }
+
+ private void TimeZoneBox_OnTextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (sender is AutoCompleteBox box && box.SelectedItem is TimeZone timeZone)
+ {
+ ViewModel.ValidateAndSetTimeZone(timeZone.Location);
+ }
+ }
+ }
+}