{"id":25363,"date":"2020-10-30T13:21:02","date_gmt":"2020-10-30T13:21:02","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=25363"},"modified":"2020-10-30T13:21:02","modified_gmt":"2020-10-30T13:21:02","slug":"match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/","title":{"rendered":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2"},"content":{"rendered":"<p style=\"text-align: justify;\">In the <a href=\"https:\/\/www.inogic.com\/blog\/2020\/10\/match-the-theme-of-dynamics-365-app-in-power-apps-control-framework-part-1\/\" target=\"_blank\" rel=\"noopener noreferrer\">last blog<\/a>, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing.<\/p>\n<p style=\"text-align: justify;\">In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main color set in the Dynamics 365 App Theme record.<\/p>\n<h2><strong>Retrieve theme record<\/strong><\/h2>\n<p style=\"text-align: justify;\">\nTo know what the main color is set in the theme record, we would need to retrieve the theme record first. Use webApi.retrieveMultipleRecords method in the updateView method of the PCF and on success, render the react component. Pass the object of the theme record to the root main component.<\/p>\n<blockquote><p>public updateView(context: ComponentFramework.Context&lt;IInputs&gt;): void {<\/p>\n<p>\/\/retrieve theme<\/p>\n<p>let options = &#8220;?$filter=isdefaulttheme eq true&#8221;;<\/p>\n<p>this._context.webAPI.retrieveMultipleRecords(&#8220;theme&#8221;, options).then((result) =&gt; {<\/p>\n<p>this._themeRecord = result.entities[0];<\/p>\n<p>\/\/ Add code to update control view<\/p>\n<p>ReactDOM.render(<\/p>\n<p>React.createElement(App, { context: this._context, themeRecord: this._themeRecord }), this._container);<\/p>\n<p>}, (error) =&gt; {<\/p>\n<p>});<\/p><\/blockquote>\n<p>This theme records contains the maincolor value.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25358 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png\" alt=\"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2\" width=\"384\" height=\"274\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png 384w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1-300x214.png 300w\" sizes=\"(max-width: 384px) 100vw, 384px\" \/><\/a><\/p>\n<h2><strong>Generate Fluent UI Palette color slots<\/strong><\/h2>\n<p style=\"text-align: justify;\">We now have maincolor but do not have the palette color slots. We want different shades of the main color, which we saw, in our <a href=\"https:\/\/www.inogic.com\/blog\/2020\/10\/match-the-theme-of-dynamics-365-app-in-power-apps-control-framework-part-1\/\" target=\"_blank\" rel=\"noopener noreferrer\">previous blog<\/a>; we copied the color slots from <a href=\"https:\/\/fabricweb.z5.web.core.windows.net\/pr-deploy-site\/refs\/heads\/master\/theming-designer\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">Fluent UI Theme designer<\/a>.<br \/>\nTo generate color slots programmatically, we would need to use <a href=\"https:\/\/docs.microsoft.com\/en-us\/javascript\/api\/office-ui-fabric-react\/themegenerator?view=office-ui-fabric-react-latest\" target=\"_blank\" rel=\"noopener noreferrer\">ThemeGenerator<\/a> Class.\u00a0 I have created a ThemeProvider.ts as a separate file with the below code.<\/p>\n<blockquote><p>import\u00a0{\u00a0loadTheme\u00a0}\u00a0from\u00a0&#8216;@uifabric\/styling&#8217;;<\/p>\n<p>import\u00a0{<\/p>\n<p>IThemeRules,<\/p>\n<p>ThemeGenerator,<\/p>\n<p>themeRulesStandardCreator,<\/p>\n<p>}\u00a0from\u00a0&#8216;office-ui-fabric-react\/lib\/ThemeGenerator&#8217;;<\/p>\n<p>import\u00a0{\u00a0getColorFromString\u00a0}\u00a0from\u00a0&#8216;office-ui-fabric-react\/lib\/utilities\/color\/getColorFromString&#8217;;<\/p>\n<p>import\u00a0{\u00a0IColor\u00a0}\u00a0from\u00a0&#8216;office-ui-fabric-react\/lib\/utilities\/color\/interfaces&#8217;;<\/p>\n<p>&nbsp;<\/p>\n<p>export\u00a0default\u00a0class\u00a0ThemeProvider\u00a0{<\/p>\n<p>private\u00a0themeRules:\u00a0IThemeRules;<\/p>\n<p>constructor()\u00a0{<\/p>\n<p>const\u00a0themeRules\u00a0=\u00a0themeRulesStandardCreator();<\/p>\n<p>ThemeGenerator.insureSlots(this.themeRules,\u00a0false);<\/p>\n<p>ThemeGenerator.setSlot(themeRules.backgroundColor,\u00a0getColorFromString(&#8216;#ffffff&#8217;)\u00a0||\u00a0&#8220;&#8221;,\u00a0false,\u00a0true,\u00a0true);<\/p>\n<p>ThemeGenerator.setSlot(themeRules.foregroundColor,\u00a0getColorFromString(&#8216;#000000&#8217;)\u00a0||\u00a0&#8220;&#8221;,\u00a0false,\u00a0true,\u00a0true);<\/p>\n<p>this.themeRules\u00a0=\u00a0themeRules;<\/p>\n<p>}<\/p>\n<p>public\u00a0loadThemeForColor(hexColor:\u00a0string):\u00a0void\u00a0{<\/p>\n<p>let\u00a0col:\u00a0IColor\u00a0=\u00a0{\u00a0str:\u00a0&#8220;#0078D4&#8221;,\u00a0r:\u00a00,\u00a0g:\u00a0120,\u00a0b:\u00a0212,\u00a0hex:\u00a0&#8220;0078d4&#8221;,\u00a0h:\u00a00,\u00a0s:\u00a00,\u00a0v:\u00a00\u00a0};<\/p>\n<p>const\u00a0newColor:\u00a0IColor\u00a0=\u00a0getColorFromString(hexColor)\u00a0||\u00a0col;<\/p>\n<p>&nbsp;<\/p>\n<p>const\u00a0themeRules\u00a0=\u00a0this.themeRules;<\/p>\n<p>ThemeGenerator.setSlot(themeRules.primaryColor,\u00a0newColor.str\u00a0||\u00a0&#8220;&#8221;,\u00a0false,\u00a0true,\u00a0true);<\/p>\n<p>this.themeRules\u00a0=\u00a0themeRules;<\/p>\n<p>const\u00a0theme\u00a0=\u00a0ThemeGenerator.getThemeAsJson(this.themeRules);<\/p>\n<p>loadTheme({<\/p>\n<p>&#8230;{\u00a0palette:\u00a0theme\u00a0},<\/p>\n<p>isInverted:\u00a0false,<\/p>\n<p>});<\/p>\n<p>}<\/p>\n<p>}<\/p><\/blockquote>\n<p style=\"text-align: justify;\">This ThemeProvider.ts has \u201cloadThemeForColor\u201d method, which accepts the color string and then generates theme and loads it.<\/p>\n<h2><strong>Load theme in the root component<\/strong><\/h2>\n<p style=\"text-align: justify;\">Import the above-created \u201cThemeProvider\u201d class in the main root component and then call \u201cloadThemeForColor\u201d method by passing the maincolor that we have retrieved from the Dynamics 365 Theme record. The theme loaded in the root component will get applied to all the child components.<\/p>\n<blockquote><p>import\u00a0ThemeProvider\u00a0from\u00a0&#8220;..\/ThemeProvider&#8221;<\/p><\/blockquote>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25360 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3.png\" alt=\"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2\" width=\"1040\" height=\"410\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3.png 1040w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-300x118.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-768x303.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-1024x404.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-660x260.png 660w\" sizes=\"(max-width: 1040px) 100vw, 1040px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Call \u201cloadThemeForColor\u201d method before any app code. Here I have called this function in the root component\u2019s constructor.<\/p>\n<blockquote><p>\u00a0\u00a0\u00a0\u00a0constructor(props:\u00a0AppProps)\u00a0{<\/p>\n<p>super(props);<\/p>\n<p>\/\/get\u00a0main\u00a0theme\u00a0color<\/p>\n<p>let\u00a0mainColor\u00a0=\u00a0props.themeRecord[&#8220;maincolor&#8221;];<\/p>\n<p>&nbsp;<\/p>\n<p>let\u00a0themeProvider\u00a0=\u00a0new\u00a0ThemeProvider();<\/p>\n<p>themeProvider.loadThemeForColor(mainColor);<\/p>\n<p>}<\/p><\/blockquote>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25360 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3.png\" alt=\"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2\" width=\"1040\" height=\"410\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3.png 1040w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-300x118.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-768x303.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-1024x404.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img3-660x260.png 660w\" sizes=\"(max-width: 1040px) 100vw, 1040px\" \/><\/a><\/p>\n<p>This way we can dynamically set the theme for the Fluent UI components.<\/p>\n<h2><strong>Test the app<\/strong><\/h2>\n<p style=\"text-align: justify;\">Deploy the control to Dynamics 365 environment, change the default theme main color, and publish.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img4.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25361 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img4.png\" alt=\"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2\" width=\"542\" height=\"329\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img4.png 542w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img4-300x182.png 300w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Our component will read this main color form the theme record and will apply the generated theme.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img5.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25357 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img5.png\" alt=\"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2\" width=\"514\" height=\"444\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img5.png 514w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img5-300x259.png 300w\" sizes=\"(max-width: 514px) 100vw, 514px\" \/><\/a><br \/>\nIn some cases, you may require to modify individual components style. As mentioned in the <a href=\"https:\/\/www.inogic.com\/blog\/2020\/10\/match-the-theme-of-dynamics-365-app-in-power-apps-control-framework-part-1\/\" target=\"_blank\" rel=\"noopener noreferrer\">previous blog<\/a><strong>,<\/strong> we can modify individual component style using <a href=\"https:\/\/github.com\/microsoft\/fluentui\/wiki\/Component-Styling\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/microsoft\/fluentui\/wiki\/Component-Styling<\/a><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p style=\"text-align: justify;\">We can apply the theme to the Fluent UI component dynamically based on the main color set in the Dynamics 365 App Theme record.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/\">Read More: Match theme of Dynamics 365 App in Power Apps Control\u2026 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,19,2053],"tags":[545,592,1169,1941,1337,1338,1710],"class_list":["post-25363","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-crm","category-power-apps-portals","tag-dynamics-365-crm","tag-dynamics-crm","tag-microsoft-power-apps","tag-pcf-control","tag-power-apps","tag-power-apps-dynamics-365-crm","tag-theme"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Tushar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"384\" \/>\n\t\t<meta property=\"og:image:height\" content=\"274\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-10-30T13:21:02+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-10-30T13:21:02+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inogicindia\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Tushar\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#blogposting\",\"name\":\"Match theme of Dynamics 365 App in Power Apps Control Framework \\u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"Match theme of Dynamics 365 App in Power Apps Control Framework \\u2013 Part 2\",\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\\u2013-Part-2-img1.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#articleImage\",\"width\":384,\"height\":274,\"caption\":\"Match theme of Dynamics 365 App in Power Apps Control Framework \\u2013 Part 2\"},\"datePublished\":\"2020-10-30T13:21:02+05:30\",\"dateModified\":\"2020-10-30T13:21:02+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#webpage\"},\"articleSection\":\"Dynamics 365, Dynamics CRM, Power Apps Portals, Dynamics 365 CRM, Dynamics CRM, Microsoft Power Apps, PCF Control, Power Apps, Power Apps Dynamics 365 CRM, Theme\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/#listItem\",\"name\":\"Dynamics 365\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/#listItem\",\"position\":2,\"name\":\"Dynamics 365\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#listItem\",\"name\":\"Match theme of Dynamics 365 App in Power Apps Control Framework \\u2013 Part 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#listItem\",\"position\":3,\"name\":\"Match theme of Dynamics 365 App in Power Apps Control Framework \\u2013 Part 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/#listItem\",\"name\":\"Dynamics 365\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"By Inogic\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/inogic-logo.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inogicindia\",\"https:\\\/\\\/twitter.com\\\/inogic\",\"https:\\\/\\\/www.instagram.com\\\/inogicindia\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCM4V7ousgLSu1hbOEv4DUuQ\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inogicindia\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/\",\"name\":\"Tushar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Tushar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/\",\"name\":\"Match theme of Dynamics 365 App in Power Apps Control Framework \\u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2020\\\/10\\\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"datePublished\":\"2020-10-30T13:21:02+05:30\",\"dateModified\":\"2020-10-30T13:21:02+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"alternateName\":\"Inogic\",\"description\":\"By Inogic\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks","description":"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main","canonical_url":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#blogposting","name":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2","author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#articleImage","width":384,"height":274,"caption":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2"},"datePublished":"2020-10-30T13:21:02+05:30","dateModified":"2020-10-30T13:21:02+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#webpage"},"articleSection":"Dynamics 365, Dynamics CRM, Power Apps Portals, Dynamics 365 CRM, Dynamics CRM, Microsoft Power Apps, PCF Control, Power Apps, Power Apps Dynamics 365 CRM, Theme"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.inogic.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/#listItem","name":"Dynamics 365"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/#listItem","position":2,"name":"Dynamics 365","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#listItem","name":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#listItem","position":3,"name":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/#listItem","name":"Dynamics 365"}}]},{"@type":"Organization","@id":"https:\/\/www.inogic.com\/blog\/#organization","name":"Microsoft Dynamics 365 CRM Tips and Tricks","description":"By Inogic","url":"https:\/\/www.inogic.com\/blog\/","logo":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/inogic-logo.png","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#organizationLogo"},"sameAs":["https:\/\/www.facebook.com\/inogicindia","https:\/\/twitter.com\/inogic","https:\/\/www.instagram.com\/inogicindia\/","https:\/\/www.youtube.com\/channel\/UCM4V7ousgLSu1hbOEv4DUuQ","https:\/\/www.linkedin.com\/company\/inogicindia"]},{"@type":"Person","@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author","url":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/","name":"Tushar","image":{"@type":"ImageObject","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Tushar"}},{"@type":"WebPage","@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/","name":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks","description":"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"datePublished":"2020-10-30T13:21:02+05:30","dateModified":"2020-10-30T13:21:02+05:30"},{"@type":"WebSite","@id":"https:\/\/www.inogic.com\/blog\/#website","url":"https:\/\/www.inogic.com\/blog\/","name":"Microsoft Dynamics 365 CRM Tips and Tricks","alternateName":"Inogic","description":"By Inogic","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic","og:type":"article","og:title":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main","og:url":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png","og:image:width":384,"og:image:height":274,"article:published_time":"2020-10-30T13:21:02+00:00","article:modified_time":"2020-10-30T13:21:02+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2 - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"In the last blog, we saw how we could match the theme of the Dynamics 365 App in PCF when we know what should be the color scheme at the time of designing. In this blog, we will see how we can apply the theme to the Fluent UI component dynamically based on the main","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Match-theme-of-Dynamics-365-App-in-Power-Apps-Control-Framework-\u2013-Part-2-img1.png","twitter:label1":"Written by","twitter:data1":"Tushar","twitter:label2":"Est. reading time","twitter:data2":"3 minutes"},"aioseo_meta_data":{"post_id":"25363","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-02-02 07:34:53","updated":"2025-07-04 08:00:57","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/\" title=\"Dynamics 365\">Dynamics 365<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMatch theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Dynamics 365","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/"},{"label":"Match theme of Dynamics 365 App in Power Apps Control Framework \u2013 Part 2","link":"https:\/\/www.inogic.com\/blog\/2020\/10\/match-theme-of-dynamics-365-app-in-power-apps-control-framework-part-2\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=25363"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25363\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=25363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=25363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=25363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}