diff --git a/RedBookPlayer/GUI/SettingsWindow.xaml.cs b/RedBookPlayer/GUI/SettingsWindow.xaml.cs index f88a3ac..cfe293e 100644 --- a/RedBookPlayer/GUI/SettingsWindow.xaml.cs +++ b/RedBookPlayer/GUI/SettingsWindow.xaml.cs @@ -44,30 +44,42 @@ namespace RedBookPlayer.GUI void InitializeComponent() { AvaloniaXamlLoader.Load(this); - - _themeList = this.FindControl("ThemeList"); - _themeList.SelectionChanged += ThemeList_SelectionChanged; - - List items = new List(); - items.Add("default"); - - if(Directory.Exists("themes/")) - { - foreach(string dir in Directory.EnumerateDirectories("themes/")) - { - string themeName = dir.Split('/')[1]; - - if (!File.Exists($"themes/{themeName}/view.xaml")) - continue; - - items.Add(themeName); - } - } - - _themeList.Items = items; + + PopulateThemes(); this.FindControl