<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: broken light theme in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/broken-light-theme/m-p/1132954#M7603</link>
    <description>&lt;P&gt;Sorry, end of year crunch. I've been meaning to get back to this topic. What I ended up doing was to implement in C#, which is much more familiar to me than XAML, and easier to debug. So in the constructor for our about box, in the .xaml.cs file, I have the following.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;public About_Modal()&lt;BR /&gt;{&lt;BR /&gt;InitializeComponent();&lt;BR /&gt;DataContext = new About_ModalModel();&lt;/P&gt;&lt;P&gt;string lightLogoPath = @"Images/terrago_logo.png".ToLower();&lt;BR /&gt;string darkLogoPath = @"DarkImages/terrago_logo.png".ToLower();&lt;/P&gt;&lt;P&gt;BitmapImage lightLogoImg = new BitmapImage();&lt;BR /&gt;lightLogoImg.BeginInit();&lt;BR /&gt;lightLogoImg.UriSource =&lt;BR /&gt;new Uri(@"pack://application:,,,/publisher-arcgispro;component/" + lightLogoPath);&lt;BR /&gt;lightLogoImg.EndInit();&lt;/P&gt;&lt;P&gt;BitmapImage darkLogoImg = new BitmapImage();&lt;BR /&gt;darkLogoImg.BeginInit();&lt;BR /&gt;darkLogoImg.UriSource =&lt;BR /&gt;new Uri(@"pack://application:,,,/publisher-arcgispro;component/" + darkLogoPath);&lt;BR /&gt;darkLogoImg.EndInit();&lt;/P&gt;&lt;P&gt;Image logoImg = this.FindName("TerraGoLogo") as Image;&lt;/P&gt;&lt;P&gt;if (FrameworkApplication.ApplicationTheme == ApplicationTheme.Default)&lt;BR /&gt;logoImg.Source = lightLogoImg;&lt;BR /&gt;else&lt;BR /&gt;logoImg.Source = darkLogoImg;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In the XAML I have the following snippet.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;lt;StackPanel HorizontalAlignment="Center" VerticalAlignment="Top"&amp;gt;&lt;BR /&gt;&amp;lt;Image Name="TerraGoLogo"&lt;BR /&gt;HorizontalAlignment="Center"&lt;BR /&gt;Height="76"&lt;BR /&gt;VerticalAlignment="Top"&lt;BR /&gt;Width="358"&lt;BR /&gt;Margin="0,10,0,5"/&amp;gt;&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&amp;lt;/StackPanel&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Wed, 12 Jan 2022 16:48:01 GMT</pubDate>
    <dc:creator>AlanStewart</dc:creator>
    <dc:date>2022-01-12T16:48:01Z</dc:date>
    <item>
      <title>broken light theme</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/broken-light-theme/m-p/1116153#M7344</link>
      <description>&lt;P&gt;ArcGIS Pro SDK 2.6, XAML&lt;/P&gt;&lt;P&gt;I'm upgrading a dialog displayed by my add-in to recognize light and dark themes. I'm following the standard community sample. I have the standard Themes, Images, and DarkImages folders. The contents of the image folders are set the Resource build action and to no copy.&lt;/P&gt;&lt;P&gt;In LightResources.xaml I have inserted:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;BitmapImage
        x:Key="TerraGoLogo"
        UriSource="../../../Images/terrago_logo.png"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;I have also tried:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;BitmapImage
        x:Key="TerraGoLogo"
        UriSource="pack://application:,,,/publisher-arcgispro;component/Resources/Images/terrago_logo.png"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;In my dialog XAML I have inserted:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        &amp;lt;Image HorizontalAlignment="Center"
               Height="76"
               VerticalAlignment="Top"
               Width="358"
               Margin="0,10,0,5"
               Source="{DynamicResource TerraGoLogo}"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dialog XAML worked before I replaced a string literal path with the DynamicResource. The path used in the first attempt is the same the original path, the relative path from the XAML file. I've also tried the path relative to the project file.&lt;/P&gt;&lt;P&gt;Now the logo does not display at runtime.&lt;/P&gt;&lt;P&gt;TIA for any help.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 23:25:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/broken-light-theme/m-p/1116153#M7344</guid>
      <dc:creator>AlanStewart</dc:creator>
      <dc:date>2021-11-11T23:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: broken light theme</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/broken-light-theme/m-p/1125589#M7485</link>
      <description>&lt;P&gt;For the &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/CustomStyling" target="_self"&gt;sample&lt;/A&gt;, I made copies by copy/pasting the images in their respective folders ...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_0-1639430384401.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29575i841E9CCDC106547F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_0-1639430384401.png" alt="KirkKuykendall1_0-1639430384401.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then added BitmapImage elements to the respective resource files:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_1-1639430470800.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29576iFB985666688B3C93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_1-1639430470800.png" alt="KirkKuykendall1_1-1639430470800.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_2-1639430521024.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29577i2D687A2B2EBAC314/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_2-1639430521024.png" alt="KirkKuykendall1_2-1639430521024.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then added an Image with a Dynamic resource to the pane:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_4-1639430841333.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29579i4B7BEE8BA6D0A059/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_4-1639430841333.png" alt="KirkKuykendall1_4-1639430841333.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Ran it and saw this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_5-1639430895816.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29580iB39B2B8F1AC5EB58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_5-1639430895816.png" alt="KirkKuykendall1_5-1639430895816.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Changed to dark theme, saw this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_6-1639430955823.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29582iCECBA34BDB7975BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_6-1639430955823.png" alt="KirkKuykendall1_6-1639430955823.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 21:32:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/broken-light-theme/m-p/1125589#M7485</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-12-13T21:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: broken light theme</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/broken-light-theme/m-p/1132954#M7603</link>
      <description>&lt;P&gt;Sorry, end of year crunch. I've been meaning to get back to this topic. What I ended up doing was to implement in C#, which is much more familiar to me than XAML, and easier to debug. So in the constructor for our about box, in the .xaml.cs file, I have the following.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;public About_Modal()&lt;BR /&gt;{&lt;BR /&gt;InitializeComponent();&lt;BR /&gt;DataContext = new About_ModalModel();&lt;/P&gt;&lt;P&gt;string lightLogoPath = @"Images/terrago_logo.png".ToLower();&lt;BR /&gt;string darkLogoPath = @"DarkImages/terrago_logo.png".ToLower();&lt;/P&gt;&lt;P&gt;BitmapImage lightLogoImg = new BitmapImage();&lt;BR /&gt;lightLogoImg.BeginInit();&lt;BR /&gt;lightLogoImg.UriSource =&lt;BR /&gt;new Uri(@"pack://application:,,,/publisher-arcgispro;component/" + lightLogoPath);&lt;BR /&gt;lightLogoImg.EndInit();&lt;/P&gt;&lt;P&gt;BitmapImage darkLogoImg = new BitmapImage();&lt;BR /&gt;darkLogoImg.BeginInit();&lt;BR /&gt;darkLogoImg.UriSource =&lt;BR /&gt;new Uri(@"pack://application:,,,/publisher-arcgispro;component/" + darkLogoPath);&lt;BR /&gt;darkLogoImg.EndInit();&lt;/P&gt;&lt;P&gt;Image logoImg = this.FindName("TerraGoLogo") as Image;&lt;/P&gt;&lt;P&gt;if (FrameworkApplication.ApplicationTheme == ApplicationTheme.Default)&lt;BR /&gt;logoImg.Source = lightLogoImg;&lt;BR /&gt;else&lt;BR /&gt;logoImg.Source = darkLogoImg;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In the XAML I have the following snippet.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;lt;StackPanel HorizontalAlignment="Center" VerticalAlignment="Top"&amp;gt;&lt;BR /&gt;&amp;lt;Image Name="TerraGoLogo"&lt;BR /&gt;HorizontalAlignment="Center"&lt;BR /&gt;Height="76"&lt;BR /&gt;VerticalAlignment="Top"&lt;BR /&gt;Width="358"&lt;BR /&gt;Margin="0,10,0,5"/&amp;gt;&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&amp;lt;/StackPanel&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 12 Jan 2022 16:48:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/broken-light-theme/m-p/1132954#M7603</guid>
      <dc:creator>AlanStewart</dc:creator>
      <dc:date>2022-01-12T16:48:01Z</dc:date>
    </item>
  </channel>
</rss>

