<?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: Light/Dark logo image in ProWindow in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197233#M8522</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here is an add-in (attached) with a ProWindow that hosts an image that switches when you change the Pro Application theme. The images are placed in the Images folder and the BuildAction is set to resource.&lt;/P&gt;&lt;P&gt;This add-in is built using Pro 3.0.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2022 05:16:12 GMT</pubDate>
    <dc:creator>UmaHarano</dc:creator>
    <dc:date>2022-07-29T05:16:12Z</dc:date>
    <item>
      <title>Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1196882#M8511</link>
      <description>&lt;P&gt;I have looked at several posts and the samples but cant seem to find an easy way to add a logo image to my ProWindow.&amp;nbsp;. Currently I have Images/logo_hrz.png and DarkImages/logo_hrz.png and they are both set as Resource and Do Not Copy. But I am struggling to tell the SDK to load the resource depending on the Pro Theme:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Image RenderTransformOrigin="-1.82,-1.377" Source="{DynamicResource logo_hrz}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="39" Width="214" Margin="5,9,0,0" Stretch="Fill"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 16:30:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1196882#M8511</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-28T16:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1196887#M8512</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Did you have chance to see this ProGuide?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="ProGuide: Custom styles" href="https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-applying-custom-styles" target="_blank" rel="noopener"&gt;ProGuide: Custom styles&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This guide walks through the process of styling a UserControl using your own resources. It also explains how to switch the resources based on Pro's application theme.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 16:40:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1196887#M8512</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2022-07-28T16:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1196993#M8513</link>
      <description>&lt;P&gt;Yes I did but thats way too much overhead for my project. All I have is just one image I have to switch and that's it.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 18:57:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1196993#M8513</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-28T18:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197050#M8514</link>
      <description>&lt;P&gt;But let me give it a try.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 19:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197050#M8514</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-28T19:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197138#M8517</link>
      <description>&lt;P&gt;What you want is something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// This is your view model or .xaml.cs if your Window is acting as its own
// DataContext

private ImageSource _imgSource = null;

public ImageSource IconImageSource {
  get {
    if (_imgSource == null) {
      var url = "";
      //check current theme
      if (FrameworkApplication.ApplicationTheme == 
                                     ApplicationTheme.Default) {
        //light theme icon
        //note: full path looks something like this:
   //@"pack://application:,,,/MyCustomApp;component/MyImages/WindowIcon.png";
        url = "/MyImages/WindowIcon.png";
      }
      else {
        //dark theme icon
        url = "/MyImages/WindowIconDark.png";
      }
      var bmp = new BitmapImage();
      bmp.BeginInit();
      bmp.UriSource = new Uri(url, UriKind.RelativeOrAbsolute);
      bmp.EndInit();
      _imgSource = bmp;
   }
   return _imgSource;
 }
}

//In your .xaml
&amp;lt;Image Source={Binding IconImageSource} .... /&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your addin, add two images - one for your "light" and one for your "dark". Make sure to set the BuildAction to "Resource". You may have to fiddle with the pack Uri. In my example, there would be two images in the addin stored in a folder called "MyImages".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notice I am _binding_ the image source to a property as opposed to setting it to a DynamicResource.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 21:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197138#M8517</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-07-28T21:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197175#M8518</link>
      <description>&lt;P&gt;Hmm I've tried every permutation of URI and it just wont work. here is what I currently have for the two URIs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;url = @"pack://application:,,,/MyCompany.MyGroup.MyAddin;component\Images\logo_hrz_grd.png";

url = @"pack://application:,,,/MyCompany.MyGroup.MyAddin;component\DarkImages\logo_hrz_grd.png";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and my xaml&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Image RenderTransformOrigin="-1.82,-1.377" Source="{Binding LogoImageSource}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="39" Width="214" Margin="5,9,0,0" Stretch="Fill"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ill try again tomorrow.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 22:58:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197175#M8518</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-28T22:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197233#M8522</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here is an add-in (attached) with a ProWindow that hosts an image that switches when you change the Pro Application theme. The images are placed in the Images folder and the BuildAction is set to resource.&lt;/P&gt;&lt;P&gt;This add-in is built using Pro 3.0.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 05:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197233#M8522</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2022-07-29T05:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197332#M8527</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/9021"&gt;@UmaHarano&lt;/a&gt;&amp;nbsp;thank you very much for the sample. One thing I did notice was that when I add a ProWindow through the VS 2022 Extension I do not get a ViewModel. Since I'm kind of newish to WPF I just thought it wasnt needed. DockPanes and PropertySheets get the ViewModel class added automatically. Is this by design?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AbelPerez_0-1659100889219.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47212iCC03A5FCE8442A0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AbelPerez_0-1659100889219.png" alt="AbelPerez_0-1659100889219.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 13:23:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197332#M8527</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-29T13:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197362#M8528</link>
      <description>&lt;P&gt;Woot!!! I got it to work. Two things that were messing me up:&lt;/P&gt;&lt;P&gt;1. The missing ViewModel which is not created by the VS extension. I had to create my own ViewModel class and then reference that in the ShowProWindow class.&lt;/P&gt;&lt;P&gt;2. The path to the image. I was under the impression that I needed to provide the namespace of the project in the path. That didn't work so I tried just the name of the project and that worked.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//"pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonPurple16.png"
url = @"pack://application:,,,/MyProject;component/Images/logo.png";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 14:20:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197362#M8528</guid>
      <dc:creator>AbelPerez</dc:creator>
      <dc:date>2022-07-29T14:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Light/Dark logo image in ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197457#M8529</link>
      <description>&lt;P&gt;please mark the post as answered&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 16:38:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/light-dark-logo-image-in-prowindow/m-p/1197457#M8529</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-07-29T16:38:28Z</dc:date>
    </item>
  </channel>
</rss>

