{"id":19418834,"url":"https://github.com/andrewkeepcoding/switchingthemessampleapp","last_synced_at":"2026-06-17T11:31:45.680Z","repository":{"id":119225379,"uuid":"479732428","full_name":"AndrewKeepCoding/SwitchingThemesSampleApp","owner":"AndrewKeepCoding","description":"This is the source code from my YouTube video about switching themes on WinUI 3 app.","archived":false,"fork":false,"pushed_at":"2024-06-13T13:33:05.000Z","size":20,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T03:43:15.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://youtu.be/w2XdbyNrXBQ","language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewKeepCoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-09T13:20:32.000Z","updated_at":"2025-02-07T14:58:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"c28ac345-c046-4dc0-82da-ab2e6a085fb1","html_url":"https://github.com/AndrewKeepCoding/SwitchingThemesSampleApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewKeepCoding/SwitchingThemesSampleApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewKeepCoding%2FSwitchingThemesSampleApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewKeepCoding%2FSwitchingThemesSampleApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewKeepCoding%2FSwitchingThemesSampleApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewKeepCoding%2FSwitchingThemesSampleApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewKeepCoding","download_url":"https://codeload.github.com/AndrewKeepCoding/SwitchingThemesSampleApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewKeepCoding%2FSwitchingThemesSampleApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34447264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T13:15:25.611Z","updated_at":"2026-06-17T11:31:45.665Z","avatar_url":"https://github.com/AndrewKeepCoding.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwitchingThemesSampleApp\nThis is the source code from my YouTube video about switching themes on WinUI 3 app.\n\nYouTube: https://youtu.be/w2XdbyNrXBQ\n\n# Update\n\nIf you want to use a `ComboBox`:\n\n```xaml\n\u003cComboBox\n    SelectedIndex=\"0\"\n    SelectionChanged=\"ComboBox_SelectionChanged\"\u003e\n    \u003cx:String\u003eDefault\u003c/x:String\u003e\n    \u003cx:String\u003eLight\u003c/x:String\u003e\n    \u003cx:String\u003eDark\u003c/x:String\u003e\n\u003c/ComboBox\u003e\n```\n\nand in code-behind, get the `IThemeSelectorService`:\n\n```cs\nprivate readonly IThemeSelectorService _themeSelectorService = Ioc.Default.GetRequiredService\u003cIThemeSelectorService\u003e();\n```\n\nand handle the `SelectionChanged` event:\n\n```cs\nprivate void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)\n{\n    if (e.AddedItems.FirstOrDefault() is not string themeName ||\n        Enum.TryParse\u003cElementTheme\u003e(themeName, out var theme) is not true)\n    {\n        return;\n    }\n\n    _themeSelectorService.SetTheme(theme);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewkeepcoding%2Fswitchingthemessampleapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewkeepcoding%2Fswitchingthemessampleapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewkeepcoding%2Fswitchingthemessampleapp/lists"}