{"id":13710656,"url":"https://github.com/UdaraAlwis/XFShellAdvThemeing","last_synced_at":"2025-05-06T19:32:21.341Z","repository":{"id":102018984,"uuid":"228668123","full_name":"UdaraAlwis/XFShellAdvThemeing","owner":"UdaraAlwis","description":"Stunning App themes with Xamarin Forms Shell! ","archived":false,"fork":false,"pushed_at":"2020-03-20T00:48:12.000Z","size":6753,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T21:44:33.290Z","etag":null,"topics":["shell","styles","themes","xamarin","xamarin-forms"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UdaraAlwis.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":"2019-12-17T17:29:27.000Z","updated_at":"2023-08-11T13:26:41.000Z","dependencies_parsed_at":"2023-04-06T20:57:27.299Z","dependency_job_id":null,"html_url":"https://github.com/UdaraAlwis/XFShellAdvThemeing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UdaraAlwis%2FXFShellAdvThemeing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UdaraAlwis%2FXFShellAdvThemeing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UdaraAlwis%2FXFShellAdvThemeing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UdaraAlwis%2FXFShellAdvThemeing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UdaraAlwis","download_url":"https://codeload.github.com/UdaraAlwis/XFShellAdvThemeing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252753679,"owners_count":21798993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["shell","styles","themes","xamarin","xamarin-forms"],"created_at":"2024-08-02T23:00:59.396Z","updated_at":"2025-05-06T19:32:16.329Z","avatar_url":"https://github.com/UdaraAlwis.png","language":"C#","funding_links":[],"categories":["Samples"],"sub_categories":[],"readme":"# XFShellAdvThemeing\nStunning App themes with Xamarin Forms Shell! \n\nYou probably already know how to in classic Xamarin.Forms, but how about Setting up App Themes in a Xamarin.Forms Shell App?, now that's what this is for. 😉 \n\nCheck out the blog post: https://theconfuzedsourcecode.wordpress.com/2019/12/26/stunning-app-themes-in-xamarin-forms-shell-projects/\n\nA little sneak peak:\n![Android](/screenshots/PreviewStepByStepDemoAndroid.png)\n\n\u003eHere we're using awesome built-in Xamarin.Forms Dynamic Binding, and Styling features to implement a neat App Theming solution.\n\u003eAn alternative for: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/theming\n\u003eBut focused on the awesome new paradigm of Xamarin.Forms Shell!\n\n### In a nutshell:\n- Define Theme files with Colors/Fonts/Images/Icons in them\n- Create Styles based on the Theme properties using Dynamic Binding\n- Bind the UI Elements to the Styles created earlier\n- Implement dynamic App Theme selection using MergedDictionaries\n- Use XF.Essentials Preferences API to save App Theme preferences\n\nSample Theme File:\n```xaml\n﻿\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\u003cResourceDictionary\n    x:Class=\"XFShellAdvThemeing.Themes.PinkTheme\"\n    xmlns=\"http://xamarin.com/schemas/2014/forms\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\u003e\n\n    \u003cColor x:Key=\"PrimaryColor\"\u003e#fc0384\u003c/Color\u003e\n    \u003cColor x:Key=\"AccentColor\"\u003e#ffb8dd\u003c/Color\u003e\n    \u003cColor x:Key=\"SecondaryColor\"\u003eWhite\u003c/Color\u003e\n\n    \u003cColor x:Key=\"PageBackgroundColor\"\u003eWhite\u003c/Color\u003e\n    \u003cColor x:Key=\"NavigationBarColor\"\u003e#fc0384\u003c/Color\u003e\n\n    \u003cColor x:Key=\"PrimaryTextColor\"\u003e#3d0020\u003c/Color\u003e\n    \u003cColor x:Key=\"SecondaryTextColor\"\u003e#610033\u003c/Color\u003e\n    \u003cColor x:Key=\"TertiaryTextColor\"\u003e#960050\u003c/Color\u003e\n\u003c/ResourceDictionary\u003e\n```\n\nSample Style:\n\n```xaml\n\u003cStyle x:Key=\"ButtonStyle\" TargetType=\"Button\"\u003e\n    \u003cSetter Property=\"BackgroundColor\" Value=\"{DynamicResource PrimaryColor}\" /\u003e\n    \u003cSetter Property=\"TextColor\" Value=\"{DynamicResource SecondaryColor}\" /\u003e\n    \u003cSetter Property=\"HeightRequest\" Value=\"45\" /\u003e\n    \u003cSetter Property=\"WidthRequest\" Value=\"190\" /\u003e\n\u003c/Style\u003e\n```\n\nSample UI Element: \n\n```xaml\n\u003cButton\n    x:Name=\"ChangeThemeButton\"\n    Clicked=\"ChangeThemeButton_Clicked\"\n    Style=\"{DynamicResource ButtonStyle}\"\n    Text=\"Change App Theme\" /\u003e\n```\n\nDynamic App Theme Switching:\n```csharp\nICollection\u003cResourceDictionary\u003e mergedDictionaries\n\t\t= Application.Current.Resources.MergedDictionaries;\n...\n...\ncase Theme.Pink:\n\tmergedDictionaries.Add(new PinkTheme());\n\tbreak;\n...\n...\n```\n\nSaving Theme Preferences: \n```csharp\nPreferences.Set(\"CurrentAppTheme\", SelectedItem.ToString());\n```\n\nBehold the beauty on Android and iOS...\n![Android](/screenshots/PreviewCollectionAndroid.png)\n![iOS](/screenshots/PreviewCollectioniOS.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUdaraAlwis%2FXFShellAdvThemeing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUdaraAlwis%2FXFShellAdvThemeing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUdaraAlwis%2FXFShellAdvThemeing/lists"}