<?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: Modifying DockPane top title style (font/colours) and colour of the top line in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/modifying-dockpane-top-title-style-font-colours/m-p/1020871#M6096</link>
    <description>&lt;P&gt;Not sure how to override this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_0-1611805029886.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4751iB66E7DB222041B93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_0-1611805029886.png" alt="KirkKuykendall1_0-1611805029886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-style-guide#available-styles" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-style-guide#available-styles&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Maybe the example here can be tweaked to do what you require:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-applying-custom-styles" target="_blank"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-applying-custom-styles&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jan 2021 03:41:17 GMT</pubDate>
    <dc:creator>KirkKuykendall1</dc:creator>
    <dc:date>2021-01-28T03:41:17Z</dc:date>
    <item>
      <title>Modifying DockPane top title style (font/colours) and colour of the top line</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/modifying-dockpane-top-title-style-font-colours/m-p/1020856#M6095</link>
      <description>&lt;P&gt;Is there a way to modify the DockPane caption colour?&lt;BR /&gt;(That is the text that appears in the dockPane tab and on top of the pane)&lt;BR /&gt;&lt;BR /&gt;Also is there a way to change the colour of the thin horizontal bar on top of a dock Pane?&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dockpane_font_colour_hz_bar.png" style="width: 655px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4748i980CFD9B5FF7EF71/image-size/large?v=v2&amp;amp;px=999" role="button" title="dockpane_font_colour_hz_bar.png" alt="dockpane_font_colour_hz_bar.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there perhaps a&amp;nbsp; &amp;lt;dockPane style? &amp;gt; to add in the config.daml ?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 01:59:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/modifying-dockpane-top-title-style-font-colours/m-p/1020856#M6095</guid>
      <dc:creator>FredericPoliart_EsriAU</dc:creator>
      <dc:date>2021-01-28T01:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying DockPane top title style (font/colours) and colour of the top line</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/modifying-dockpane-top-title-style-font-colours/m-p/1020871#M6096</link>
      <description>&lt;P&gt;Not sure how to override this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_0-1611805029886.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4751iB66E7DB222041B93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_0-1611805029886.png" alt="KirkKuykendall1_0-1611805029886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-style-guide#available-styles" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-style-guide#available-styles&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Maybe the example here can be tweaked to do what you require:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-applying-custom-styles" target="_blank"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/proguide-applying-custom-styles&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 03:41:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/modifying-dockpane-top-title-style-font-colours/m-p/1020871#M6096</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-01-28T03:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying DockPane top title style (font/colours) and colour of the top line</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/modifying-dockpane-top-title-style-font-colours/m-p/1022272#M6113</link>
      <description>&lt;P&gt;It might be easier to use VS Live Visual Tree to find what elements Esri uses in their controls, then use Microsoft's VisualTreeHelper to find those elements and change their properties.&lt;/P&gt;&lt;P&gt;Before:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_0-1612210498319.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/5040i4962D8F562A5739A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_0-1612210498319.png" alt="KirkKuykendall1_0-1612210498319.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_1-1612210551749.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/5041iE508DC7D1E1847EF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_1-1612210551749.png" alt="KirkKuykendall1_1-1612210551749.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The live visual tree is kinda quirky, but this works:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_2-1612210668032.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/5042i4D3E1376DA12CB53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_2-1612210668032.png" alt="KirkKuykendall1_2-1612210668032.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Eventually Visual Studio should show what you picked:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KirkKuykendall1_3-1612210723015.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/5043i022F383C9561FEDC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KirkKuykendall1_3-1612210723015.png" alt="KirkKuykendall1_3-1612210723015.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now use VisualTreeHelper to find the elements. From the code behind:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void Button_Click(object sender, RoutedEventArgs e)
{
    try
    {
        // use VS "live visual tree" to determine what to change
        var newBrush = new SolidColorBrush(Colors.Green);
        var toolwindow = GetAncestor("ToolWindowContainer");
        var list = GetFlattenedList(toolwindow);
        var border = list.OfType&amp;lt;Border&amp;gt;()
                    .Where(b =&amp;gt; b.Name == "esri_colorBar").FirstOrDefault();
        if (border == null)
            throw new Exception("esri_colorBar not found");
        border.Background = newBrush;
        var title = list.OfType&amp;lt;TextBlock&amp;gt;()
                    .Where(tb =&amp;gt; tb.Name == "title").FirstOrDefault();
        if (title == null)
            throw new Exception("title textblock not found");
        title.Foreground = newBrush;
    }
    catch (Exception ex)
    {
        Debug.Print(ex.Message);
    }
}
private DependencyObject GetAncestor(string prefix)
{
    var depObj = VisualTreeHelper.GetParent(this);
    FrameworkElement elem = this;
    while (depObj != null &amp;amp;&amp;amp; !depObj.ToString().StartsWith(prefix))
    {
        //Debug.Print($"{depObj}");
        depObj = VisualTreeHelper.GetParent(depObj);
    }
    if (depObj == null)
        throw new Exception($"{prefix} not found");
    return depObj;
}
private List&amp;lt;DependencyObject&amp;gt; GetFlattenedList(DependencyObject o)
{
    var outList = new List&amp;lt;DependencyObject&amp;gt;();
    var stack = new Stack&amp;lt;DependencyObject&amp;gt;();
    stack.Push(o);
    while(stack.Count &amp;gt; 0)
    {
        o = stack.Pop();
        for(int i = 0;i&amp;lt; VisualTreeHelper.GetChildrenCount(o);i++)
        {
            var child = VisualTreeHelper.GetChild(o, i);
            stack.Push(child);
            outList.Add(child);
        }
    }
    return outList;
}&lt;/LI-CODE&gt;&lt;P&gt;Of course if Esri changes something in a future release this might break.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 20:25:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/modifying-dockpane-top-title-style-font-colours/m-p/1022272#M6113</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-02-01T20:25:23Z</dc:date>
    </item>
  </channel>
</rss>

