<?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 Custom Control and colors for dark and light theme challenges in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1283320#M9736</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm struggling to get a custom control to behave like a standard button on the ribbon.&lt;/P&gt;&lt;P&gt;My custom control is basically the same as a medium size button (text and image), a little notification badge appears on the button which is my embellishment and irrelevant to this question so I'll leave that out.&lt;/P&gt;&lt;P&gt;When I mouse over in dark mode it should be dark grey (like other standard controls), but it shows up as a pale blue (I think the same as the light theme).&lt;/P&gt;&lt;P&gt;Also the esri image I have embedded into the button doesn't seem to respect dark mode.&lt;/P&gt;&lt;P&gt;The following image should help explain:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vidar_0-1682602513258.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69297i79EC480CB5A02B9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vidar_0-1682602513258.png" alt="Vidar_0-1682602513258.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the XAML, which may prove useful:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;UserControl.Resources&amp;gt;
        &amp;lt;ResourceDictionary&amp;gt;
            &amp;lt;ResourceDictionary.MergedDictionaries&amp;gt;
                &amp;lt;extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/&amp;gt;
            &amp;lt;/ResourceDictionary.MergedDictionaries&amp;gt;
        &amp;lt;/ResourceDictionary&amp;gt;
    &amp;lt;/UserControl.Resources&amp;gt;
    &amp;lt;Grid Width="120" Height="22"&amp;gt;
        &amp;lt;Button BorderThickness="0" Background="Transparent"  Command="{Binding CommandShowDataGroups}" &amp;gt;
            &amp;lt;StackPanel Orientation="Horizontal"  Width="120" Height="22"&amp;gt;

                &amp;lt;!--Grid only used to overlay the badge over the icon, it uses the same coloumn 0--&amp;gt;
                &amp;lt;Grid&amp;gt;
                    &amp;lt;Grid.ColumnDefinitions&amp;gt;
                        &amp;lt;ColumnDefinition Width="18"&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                        &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                    &amp;lt;/Grid.ColumnDefinitions&amp;gt;

                    &amp;lt;Image Grid.Column="0" Margin="2 0 0 0" Source="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/VariableCategoryKeyUSData16.png" Width="16" Height="16" Stretch="None"/&amp;gt;
                    &amp;lt;ui:BadgeControl Grid.Column="0" Visibility="{Binding IsBadgeVisible}" BadgeControlText="{Binding BadgeText}" BadgeControlColor="{Binding BadgeColor}" Width="15" Height="17"&amp;gt;&amp;lt;/ui:BadgeControl&amp;gt;
                    &amp;lt;TextBlock Foreground="{DynamicResource Esri_TextStyleDefaultBrush}" Grid.Column="1" Margin="4 0 0 0" FontSize="12" TextWrapping="Wrap" VerticalAlignment="Center" TextAlignment="left" Width="100" Text="Data Groups"&amp;gt;&amp;lt;/TextBlock&amp;gt;
                &amp;lt;/Grid&amp;gt;
            &amp;lt;/StackPanel&amp;gt;
        &amp;lt;/Button&amp;gt;
    &amp;lt;/Grid&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone assist?&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>Thu, 27 Apr 2023 13:38:31 GMT</pubDate>
    <dc:creator>Vidar</dc:creator>
    <dc:date>2023-04-27T13:38:31Z</dc:date>
    <item>
      <title>Custom Control and colors for dark and light theme challenges</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1283320#M9736</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm struggling to get a custom control to behave like a standard button on the ribbon.&lt;/P&gt;&lt;P&gt;My custom control is basically the same as a medium size button (text and image), a little notification badge appears on the button which is my embellishment and irrelevant to this question so I'll leave that out.&lt;/P&gt;&lt;P&gt;When I mouse over in dark mode it should be dark grey (like other standard controls), but it shows up as a pale blue (I think the same as the light theme).&lt;/P&gt;&lt;P&gt;Also the esri image I have embedded into the button doesn't seem to respect dark mode.&lt;/P&gt;&lt;P&gt;The following image should help explain:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vidar_0-1682602513258.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69297i79EC480CB5A02B9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vidar_0-1682602513258.png" alt="Vidar_0-1682602513258.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the XAML, which may prove useful:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;UserControl.Resources&amp;gt;
        &amp;lt;ResourceDictionary&amp;gt;
            &amp;lt;ResourceDictionary.MergedDictionaries&amp;gt;
                &amp;lt;extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/&amp;gt;
            &amp;lt;/ResourceDictionary.MergedDictionaries&amp;gt;
        &amp;lt;/ResourceDictionary&amp;gt;
    &amp;lt;/UserControl.Resources&amp;gt;
    &amp;lt;Grid Width="120" Height="22"&amp;gt;
        &amp;lt;Button BorderThickness="0" Background="Transparent"  Command="{Binding CommandShowDataGroups}" &amp;gt;
            &amp;lt;StackPanel Orientation="Horizontal"  Width="120" Height="22"&amp;gt;

                &amp;lt;!--Grid only used to overlay the badge over the icon, it uses the same coloumn 0--&amp;gt;
                &amp;lt;Grid&amp;gt;
                    &amp;lt;Grid.ColumnDefinitions&amp;gt;
                        &amp;lt;ColumnDefinition Width="18"&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                        &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
                    &amp;lt;/Grid.ColumnDefinitions&amp;gt;

                    &amp;lt;Image Grid.Column="0" Margin="2 0 0 0" Source="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/VariableCategoryKeyUSData16.png" Width="16" Height="16" Stretch="None"/&amp;gt;
                    &amp;lt;ui:BadgeControl Grid.Column="0" Visibility="{Binding IsBadgeVisible}" BadgeControlText="{Binding BadgeText}" BadgeControlColor="{Binding BadgeColor}" Width="15" Height="17"&amp;gt;&amp;lt;/ui:BadgeControl&amp;gt;
                    &amp;lt;TextBlock Foreground="{DynamicResource Esri_TextStyleDefaultBrush}" Grid.Column="1" Margin="4 0 0 0" FontSize="12" TextWrapping="Wrap" VerticalAlignment="Center" TextAlignment="left" Width="100" Text="Data Groups"&amp;gt;&amp;lt;/TextBlock&amp;gt;
                &amp;lt;/Grid&amp;gt;
            &amp;lt;/StackPanel&amp;gt;
        &amp;lt;/Button&amp;gt;
    &amp;lt;/Grid&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone assist?&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>Thu, 27 Apr 2023 13:38:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1283320#M9736</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2023-04-27T13:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Control and colors for dark and light theme challenges</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1283877#M9750</link>
      <description>&lt;P&gt;Button controls have a Pro Style. Can you try adding this style to you button element?&lt;/P&gt;&lt;P&gt;Style="{DynamicResource Esri_Button}"&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 14:25:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1283877#M9750</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2023-04-28T14:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Control and colors for dark and light theme challenges</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1284635#M9755</link>
      <description>&lt;P&gt;Hi Uma,&lt;/P&gt;&lt;P&gt;I tried this but it does something weird to the padding or margins, see below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vidar_0-1683023860030.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69636iBAFC0D08262CD08C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vidar_0-1683023860030.png" alt="Vidar_0-1683023860030.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;I think this style is meant for buttons on forms, not ribbons (maybe).&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 10:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1284635#M9755</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2023-05-02T10:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Control and colors for dark and light theme challenges</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1288270#M9797</link>
      <description>&lt;P&gt;You are correct the Margins get set by the esri button style.&amp;nbsp; But you can override the Margins:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Button BorderThickness="0" Background="Transparent" 
            Command="{Binding CommandShowDataGroups}" Style="{DynamicResource Esri_Button}" 
            Margin="0"&amp;gt;
  &amp;lt;StackPanel Orientation="Horizontal"  Width="120" Height="22"&amp;gt;
   ...
  &amp;lt;/StackPanel&amp;gt;
&amp;lt;/Button&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Now you get the same 'theme' behavior as if you use the Button in a Dockpane:&lt;/P&gt;&lt;P&gt;Ribbon - mouseover:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1683825669346.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70446i65ECC06ECFE35DDC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1683825669346.png" alt="Wolf_0-1683825669346.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Dockpane mouseover:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_1-1683825715107.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70447iB4A1F1494170A55B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_1-1683825715107.png" alt="Wolf_1-1683825715107.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 17:22:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/custom-control-and-colors-for-dark-and-light-theme/m-p/1288270#M9797</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-05-11T17:22:10Z</dc:date>
    </item>
  </channel>
</rss>

