Getting Esri Brushes to appear as dynamic resources in Visual Studio?

113
1
12-13-2018 06:14 AM
Highlighted
New Contributor

I used the ArcGIS Pro SDK to create my Add-In project and to create a Dockpane but the Esri Brushes don't show up as Dynamic Resources

According to https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-style-guide

"ArcGIS Pro XAML styles should be used as DynamicResources while styling the UI elements in an add-in. Add this code snippet to your xaml so that these Dynamic resources will load in Design mode in Visual Studio."

<UserControl ...
      xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
      ...>
<UserControl.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
     <extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
            </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
 </UserControl.Resources>

However, the SDK already puts this reference in the .xaml file but no dynamic resources show up in the Designer options. And manually typing in the Esri Brush name doesn't do anything.

Reply
0 Kudos
1 Reply
Highlighted
Esri Regular Contributor

Hi Chris

To clarify, the sentence in the Style Guide needs to be changed to this (thanks for catching that):

"ArcGIS Pro XAML styles should be used as DynamicResources while styling the UI elements in an add-in. Add this code snippet to your xaml so that these Dynamic resources will be applied to your control in the XAML Designer in Visual Studio."

To test, I did this: When I add a button control to a dockpane in an add-in and define a Esri brush as a Dynamic resource for the button's background, the XAML Designer displays this brush - in some cases I noticed a few second lag time.  See screenshot below:

I was wondering if you could explain what you mean by this:  However, the SDK already puts this reference in the .xaml file but no dynamic resources show up in the Designer options. And manually typing in the Esri Brush name doesn't do anything.

Thanks!

Uma

Reply
0 Kudos