Select to view content in your preferred language

custom resources.dll file containing images

657
6
09-15-2023 10:46 AM
JonathanDewalt
New Contributor III

I have a custom resources.dll file that contains both Images and DarkImages.  When i reference and use images from this dll, it appears to only use the light themed images from the Images folder and ignores the DarkImages.  Does anyone know what needs to be done to make use of both image versions?

 

dll is referenced following this:

https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-content-and-image-resources#using-images-from-a...

Thanks,

Jon

 

 

 

0 Kudos
6 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

You need to create dark and light themes as in Esri ArcGIS Pro community sample

0 Kudos
JonathanDewalt
New Contributor III
I looked at the dark / light theme for custom controls. I just want to grab my icons from a separate resources dll just like it mentions in the link above. I'm not changing theme colours and that example did not make anything clearer for me.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Another way is to check what theme is loaded in ArcGIS Pro and load different resource dll depending on theme.

https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic10163.html 

0 Kudos
JonathanDewalt
New Contributor III
That would work if I create two separate resource.dll files, one for light and one for dark. Currently I have one dll that has both light and dark image collections(Images / DarkImages) but Pro is only pulling images from the Image folder regardless whether in light or dark mode. Not sure if something extra is required in the resource file to tell it to use the darkimages folder
0 Kudos
GKmieliauskas
Esri Regular Contributor

You ask about things that are not part of ArcGIS Pro. It is WPF part. You need to create different resource dictionaries for each theme. Each theme dictionary must contain images for current theme 

https://learn.microsoft.com/en-us/windows/apps/design/style/xaml-theme-resources 

 

 

<ResourceDictionary>
  <ResourceDictionary.ThemeDictionaries>
    <ResourceDictionary x:Key="Light">
      <SolidColorBrush x:Key="myBrush" Color="{StaticResource ControlFillColorDefault}"/>
      <BitmapImage x:Key="Connected" UriSource="/Image/connected.png"/>
    </ResourceDictionary>
    <ResourceDictionary x:Key="Dark">
      <SolidColorBrush x:Key="myBrush" Color="{StaticResource ControlFillColorDefault}"/>
      <BitmapImage x:Key="Connected" UriSource="/DarkImage/connected.png"/>
    </ResourceDictionary>
  </ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>

 

 

0 Kudos
JonathanDewalt
New Contributor III
Ok..So this link pretty much is usless for making use of icons sets in a custom dll.
https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-content-and-image-resources#using-images-from-a...



0 Kudos