zhaw-dnet2/Tasks/Lab12/TodoDetails/View/SettingsPage.xaml.cs

22 lines
462 B
C#
Raw Normal View History

2024-06-06 22:12:52 +00:00
using TodoDetails.ViewModel;
namespace TodoDetails.View;
public partial class SettingsPage : ContentPage
{
public SettingsPage(SettingsViewModel viewModel)
{
InitializeComponent();
BindingContext = viewModel;
}
private void SelectedThemeChanged(object sender, EventArgs e)
{
var selectedItem = (string)ThemePicker.SelectedItem;
if (selectedItem != null)
{
(BindingContext as SettingsViewModel)?.LoadNewTheme(selectedItem);
}
}
}