How can I access Esri styles and brushes programatically. I searched everywhere to find something like SystemColors.ActiveBorderBrush. I want to create controls dynamically by code but can't find a way to add the style.
Hi
You can try something like this code snippet below. All the Esri brushes are listed in the wiki page shared by Wolf above.
<SPAN class="keyword token">var</SPAN> esriBrush <SPAN class="operator token">=</SPAN> Application<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">.</SPAN>Resources<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"Esri_BorderPressedBrush"</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="keyword token">as</SPAN> Brush<SPAN class="punctuation token">;</SPAN> textBlock<SPAN class="punctuation token">.</SPAN>Foreground <SPAN class="operator token">=</SPAN> esriBrush<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks
Uma
I have read and review all of this but still the only way to use Esri styles and brushes is through DynamicResources. I can't find nothing in SDK where I would be able to do this but with Esri Brushes
TextBlock descrip = new TextBlock() { Visibility = Windows.Visibility.Visible, TextWrapping = TextWrapping.Wrap, TextTrimming = TextTrimming.CharacterEllipsis,Background = Media.Brushes.Black };
There is a ProGuide for styling: ProGuide Style Guide · Esri/arcgis-pro-sdk Wiki · GitHub and there are references for brushes and colors:
And here is some sample code that might be of help: arcgis-pro-sdk-community-samples/Framework/Styling-with-ArcGIS-Pro at master · Esri/arcgis-pro-sdk-community-samples · G…
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.